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

16691번 - House Numbers 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 512 MB (추가 메모리 없음)117887681.720%

문제

Peter was walking down the street, and noticed that the street had houses numbered sequentially from m to n. While standing at a particular house x, he also noticed that the sum of the house numbers behind him (numbered from m to x − 1) equaled the sum of the house numbers in front of him (numbered from x + 1 to n).

Given m, and assuming there are at least three houses total, find the lowest n such that this is possible.

입력

Input consists of a single line containing the integer m (1 ≤ m ≤ 1,000,000).

출력

On a single line, print m, x, and n, in order, separated by spaces.

It is guaranteed that there will be a solution with n less than or equal to 10,000,000.

제한

예제 입력 1

1

예제 출력 1

1 6 8

예제 입력 2

11

예제 출력 2

11 49 68

예제 입력 3

999999

예제 출력 3

999999 1317141 1571535

예제 입력 4

999000

예제 출력 4

999000 1000000 1000999

힌트

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2018 Pacific Northwest Region Programming Contest > Division 2 R번

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

출처

대학교 대회

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

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