시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 128 MB127016402473051.041%

문제

각각 부피가 A, B, C(1≤A, B, C≤200) 리터인 세 개의 물통이 있다. 처음에는 앞의 두 물통은 비어 있고, 세 번째 물통은 가득(C 리터) 차 있다. 이제 어떤 물통에 들어있는 물을 다른 물통으로 쏟아 부을 수 있는데, 이때에는 한 물통이 비거나, 다른 한 물통이 가득 찰 때까지 물을 부을 수 있다. 이 과정에서 손실되는 물은 없다고 가정한다.

이와 같은 과정을 거치다보면 세 번째 물통(용량이 C인)에 담겨있는 물의 양이 변할 수도 있다. 첫 번째 물통(용량이 A인)이 비어 있을 때, 세 번째 물통(용량이 C인)에 담겨있을 수 있는 물의 양을 모두 구해내는 프로그램을 작성하시오.

입력

첫째 줄에 세 정수 A, B, C가 주어진다.

출력

첫째 줄에 공백으로 구분하여 답을 출력한다. 각 용량은 오름차순으로 정렬한다.

예제 입력 1

8 9 10

예제 출력 1

1 2 8 9 10
W3sicHJvYmxlbV9pZCI6IjIyNTEiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJiM2NcdWQxYjUiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YWMwMVx1YWMwMSBcdWJkODBcdWQ1M2NcdWFjMDAgQSwgQiwgQygxJmxlO0EsIEIsIEMmbGU7MjAwKSBcdWI5YWNcdWQxMzBcdWM3NzggXHVjMTM4IFx1YWMxY1x1Yzc1OCBcdWJiM2NcdWQxYjVcdWM3NzQgXHVjNzg4XHViMmU0LiBcdWNjOThcdWM3NGNcdWM1ZDBcdWIyOTQgXHVjNTVlXHVjNzU4IFx1YjQ1MCBcdWJiM2NcdWQxYjVcdWM3NDAgXHViZTQ0XHVjNWI0IFx1Yzc4OFx1YWNlMCwgXHVjMTM4IFx1YmM4OFx1YzlmOCBcdWJiM2NcdWQxYjVcdWM3NDAgXHVhYzAwXHViNGRkKEMgXHViOWFjXHVkMTMwKSBcdWNjMjggXHVjNzg4XHViMmU0LiBcdWM3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IGFsbCB0aGUgcG9zc2libGUgbnVtYmVyIG9mIGxpdGVycyBvZiBtaWxrIHRoYXQgY2FuIGJlIGluIGJ1Y2tldCBDIHdoZW4gYnVja2V0IEEgaXMgZW1wdHkuIE9uZSBzcGFjZSBiZXR3ZWVuIG51bWJlcnMsIHBsZWFzZS4gTm8gZXh0cmEgc3BhY2VzIG9uIGVuZCBvZiB0aGUgbGluZS48XC9wPlxyXG4iLCJoaW50IjoiIiwib3JpZ2luYWwiOiIxIiwiaHRtbF90aXRsZSI6IjAiLCJwcm9ibGVtX2xhbmdfdGNvZGUiOiJFbmdsaXNoIn1d

출처

Olympiad > USA Computing Olympiad > 2000-2001 Season > USACO Winter 2001 Contest > Orange 4번

  • 문제의 오타를 찾은 사람: kesakiyo
  • 데이터를 추가한 사람: methylene