[USACO 2007 Mar L]Professor Snarf
题号:NC25067
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

Bessie went down to town to see her former teacher, Professor Snarf.
Snarf was a clever math professor who often answered questions in "Where do you live?" asked Bessie.
"I live on University Drive, of course," said Snarf. "University Drive is an interesting street since all the houses are on the same side of the road looking at the beautiful University Park. The houses start at number 1 and are numbered sequentially through N. If I stick my head out the door and calculate the sum of all the house numbers to my right, I note that it is the same sum as the sum of the house numbers to my left. Isn't that interesting?"
Bessie knows that Snarf's address is larger than some integer A (3 <= A <= 1,940,500). Given A, calculate Snarf's smallest possible address and N, the number of houses on his street.
Bessie wants to test your program and will tell you that A is 3. Your program should figure out that Snarf lives at house 6 of 8 houses on the street (since 1+2+3+4+5 = 15 = 7+8).

输入描述:

Line 1: A single integer: A

输出描述:

Line 1: A single line with two space-separated integers: Snarf's address and N
示例1

输入

复制
3

输出

复制
6 8