시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 1537 1149 1111 77.747%

문제

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+XHJcblxyXG48cD40XHViM2M0IDEyXHVjNzU4IFx1YzU3ZFx1YzIxO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XNoZWQgd2hlbiB0aGUgbnVtYmVycyBhcmUgMCAwOyBkbyBub3QgcHJvY2VzcyB0aGlzIGxpbmUuJm5ic3A7PFwvcD5cclxuIiwib3V0cHV0IjoiPHA+T3V0cHV0IGNvbnNpc3RzIG9mIG9uZSBsaW5lIGZvciBlYWNoIGxpbmUgb2YgaW5wdXQuIFRoZSBsaW5lIHdpbGwgY29uc2lzdCBvZiB0aGUgd29yZCBmYWN0b3IgaWYgdGhlIGZpcnN0IG51bWJlciBpcyBhIGZhY3RvciBvZiB0aGUgc2Vjb25kIG51bWJlciwgdGhlIHdvcmQgbXVsdGlwbGUgaWYgdGhlIGZpcnN0IG51bWJlciBpcyBhIG11bHRpcGxlIG9mIHRoZSBzZWNvbmQgbnVtYmVyIG9yIHRoZSB3b3JkIG5laXRoZXIgaWYgdGhlIGZpcnN0IG51bWJlciBpcyBuZWl0aGVyIGEgZmFjdG9yIG5vciBhIG11bHRpcGxlIG9mIHRoZSBzZWNvbmQgbnVtYmVyLiZuYnNwOzxcL3A+XHJcbiIsImhpbnQiOiIiLCJvcmlnaW5hbCI6IjEiLCJwcm9ibGVtX2xhbmdfY29kZSI6Ilx1YzYwMVx1YzViNCJ9XQ==

출처

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

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