시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 1608 1196 1152 77.005%

문제

4 × 3 = 12이다.

이 식을 통해 다음과 같은 사실을 알 수 있다.

3은 12의 약수이고, 12는 3의 배수이다.

4도 12의 약수이고, 12는 4의 배수이다.

두 수가 주어졌을 때, 다음 3가지 중 어떤 관계인지 구하는 프로그램을 작성하시오.

  1. 첫 번째 숫자가 두 번째 숫자의 약수이다.
  2. 첫 번째 숫자가 두 번째 숫자의 배수이다.
  3. 첫 번째 숫자가 두 번째 숫자의 약수와 배수 모두 아니다.

입력

입력은 여러 테스트 케이스로 이루어져 있다. 각 테스트 케이스는 두 자연수로 이루어져 있다. 마지막 줄에는 0이 2개 주어진다. 두 수가 같은 경우는 없다.

출력

각 테스트 케이스마다 첫 번째 숫자가 두 번째 숫자의 약수라면 factor를, 배수라면 multiple을, 둘 다 아니라면 neither를 출력한다.

예제 입력 1

8 16
32 4
17 5
0 0

예제 출력 1

factor
multiple
neither
W3sicHJvYmxlbV9pZCI6IjUwODYiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJjMzBcdWMyMThcdWM2NDAgXHVjNTdkXHVjMjE4IiwiZGVzY3JpcHRpb24iOiI8cD40ICZ0aW1lczsgMyA9IDEyXHVjNzc0XHViMmU0LjxcL3A+XHJcblxyXG48cD5cdWM3NzQgXHVjMmRkXHVjNzQ0IFx1ZDFiNVx1ZDU3NCBcdWIyZTRcdWM3NGNcdWFjZmMgXHVhYzE5XHVjNzQwIFx1YzBhY1x1YzJlNFx1Yzc0NCBcdWM1NGMgXHVjMjE4IFx1Yzc4OFx1YjJlNC48XC9wPlxyXG5cclxuPHA+M1x1Yzc0MCAxMlx1Yzc1OCBcdWM1N2RcdWMyMThcdWM3NzRcdWFjZTAsIDEyXHViMjk0IDNcdWM3NTggXHViYzMwXHVjMjE4XHVjNzc0XHViMmU0LjxcL3A+XHJcblxyXG48cD40XHViM2M0IDEyXHVjNzU4IFx1YzU3Z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BmaW5pc2hlZCB3aGVuIHRoZSBudW1iZXJzIGFyZSAwIDA7IGRvIG5vdCBwcm9jZXNzIHRoaXMgbGluZS4mbmJzcDs8XC9wPlxyXG4iLCJvdXRwdXQiOiI8cD5PdXRwdXQgY29uc2lzdHMgb2Ygb25lIGxpbmUgZm9yIGVhY2ggbGluZSBvZiBpbnB1dC4gVGhlIGxpbmUgd2lsbCBjb25zaXN0IG9mIHRoZSB3b3JkIGZhY3RvciBpZiB0aGUgZmlyc3QgbnVtYmVyIGlzIGEgZmFjdG9yIG9mIHRoZSBzZWNvbmQgbnVtYmVyLCB0aGUgd29yZCBtdWx0aXBsZSBpZiB0aGUgZmlyc3QgbnVtYmVyIGlzIGEgbXVsdGlwbGUgb2YgdGhlIHNlY29uZCBudW1iZXIgb3IgdGhlIHdvcmQgbmVpdGhlciBpZiB0aGUgZmlyc3QgbnVtYmVyIGlzIG5laXRoZXIgYSBmYWN0b3Igbm9yIGEgbXVsdGlwbGUgb2YgdGhlIHNlY29uZCBudW1iZXIuJm5ic3A7PFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsInByb2JsZW1fbGFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

ACM-ICPC > Regionals > South Pacific > South Pacific Region > New Zealand Programming Contest > NZPC 2011 A번

  • 문제를 번역한 사람: baekjoon
  • 빠진 조건을 찾은 사람: psu9808
  • 잘못된 조건을 찾은 사람: toysmars