Logo
(追記) (追記ここまで)

6971번 - Nasty Numbers 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB1731219469.118%

문제

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.

제한

예제 입력 1

4
6
24
30420
10078

예제 출력 1

6 is nasty
24 is nasty
30420 is nasty
10078 is not nasty

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 1997 > CCC 1997 2번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /