시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 1725 1277 1221 76.265%

문제

4 × 3 = 12이다.

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

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

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

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

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

입력

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

출력

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

예제 입력 1

8 16
32 4
17 5
0 0

예제 출력 1

factor
multiple
neither
W3sicHJvYmxlbV9pZCI6IjUwODYiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJjMzBcdWMyMThcdWM2NDAgXHVjNTdkXHVjMjE4IiwiZGVzY3JpcHRpb24iOiI8cD40ICZ0aW1lczsgMyA9IDEyXHVjNzc0XHViMmU0LjxcL3A+XHJcblxyXG48cD5cdWM3NzQgXHVjMmRkXHVjNzQ0IFx1ZDFiNVx1ZDU3NCBcdWIyZTRcdWM3NGNcdWFjZmMgXHVhYzE5XHVjNzQwIFx1YzBhY1x1YzJlNFx1Yzc0NCBcdWM1NGMgXHVjMjE4IFx1Yzc4OFx1YjJlNC48XC9wPlxyXG5cclxuPHA+M1x1Yzc0MCAxMlx1Yzc1OCBcdWM1N2RcdWMyMThcdWM3NzRcdWFjZTAsIDEyXHViMjk0IDNcdWM3NTggXHViYzMwXHVjMjE4XHVjNzc0XHViMmU0LjxcL3A+XHJcblxyXG48cD40XHViM2M0IDEyXHVjNzU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cyB0aGFuIDEwLDAwMCwgc2VwYXJhdGVkIGJ5IGEgc3BhY2UuIElucHV0IGlzIGZpbmlzaGVkIHdoZW4gdGhlIG51bWJlcnMgYXJlIDAgMDsgZG8gbm90IHByb2Nlc3MgdGhpcyBsaW5lLiZuYnNwOzxcL3A+XHJcbiIsIm91dHB1dCI6IjxwPk91dHB1dCBjb25zaXN0cyBvZiBvbmUgbGluZSBmb3IgZWFjaCBsaW5lIG9mIGlucHV0LiBUaGUgbGluZSB3aWxsIGNvbnNpc3Qgb2YgdGhlIHdvcmQgZmFjdG9yIGlmIHRoZSBmaXJzdCBudW1iZXIgaXMgYSBmYWN0b3Igb2YgdGhlIHNlY29uZCBudW1iZXIsIHRoZSB3b3JkIG11bHRpcGxlIGlmIHRoZSBmaXJzdCBudW1iZXIgaXMgYSBtdWx0aXBsZSBvZiB0aGUgc2Vjb25kIG51bWJlciBvciB0aGUgd29yZCBuZWl0aGVyIGlmIHRoZSBmaXJzdCBudW1iZXIgaXMgbmVpdGhlciBhIGZhY3RvciBub3IgYSBtdWx0aXBsZSBvZiB0aGUgc2Vjb25kIG51bWJlci4mbmJzcDs8XC9wPlxyXG4iLCJoaW50IjoiIiwib3JpZ2luYWwiOiIxIiwicHJvYmxlbV9sYW5nX2NvZGUiOiJcdWM2MDFcdWM1YjQifV0=

출처

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

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