시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 121 | 78 | 60 | 63.830% |
We will call a positive integer "Nasty" if it has at least two pairs of positive integer factors such that the difference of one pair equals the sum of the other pair.
For example, 6 is nasty since 6 × 1 = 6, 2 × 3 = 6, and 6 – 1 = 2 + 3; and 24 is also nasty since 12 – 2 = 6 + 4.
Write a program which accepts as input a list of positive integers and determine if each one is nasty or not.
The input file is a list of positive integers, one per line. The first number in the list is the number of integers to be tested, and is at most 20. The integers to be tested are all less than 32001.
The output file should contain one line for each test value. Each line is to contain the test value and whether it is nasty or not.
4 6 24 30420 10078
6 is nasty 24 is nasty 30420 is nasty 10078 is not nasty