What is your Suneung score?
InterviewTime limit1sMemory limit1024 MB
Given a student ID, find every pair of Korean-English and math-inquiry score differences that produces it under the Hanyang formula.
- Level
Easy3 of 10
- Topics
- Brute force, Math, Implementation
- Solved
- No attempts yet
Problem
Kim Hanyang entered Hanyang University in 2023 after seven attempts at the Suneung. With your help, he finished course registration without trouble and started college life.
Enjoying campus life, he joined FORIF, the best coding club at Hanyang University. There he drank until dawn and suddenly wanted to brag about his Suneung score. He drank so much that he could not remember the score. Frustrated, he suddenly remembered his student ID number.
Hanyang University is called the Engine of Korea, so it uses a special formula to build student IDs. To find the ID, you need the exact Suneung score (standard score).
- If the Korean score is higher than the English score, multiply the difference of the two scores by the building number of the Humanities Hall, . Otherwise, multiply the difference by the building number of the International Hall, .
- If the math score is higher than the inquiry score, multiply the difference of the two scores by the building number of Engineering Hall 1, . Otherwise, multiply the difference by the building number of the ITBT Hall, .
- Add the two values above, then multiply the sum by the postal code of Hanyang University, . The result is the student ID.
He came back to you and asked you to find his Suneung scores again. Given his student ID, write a program that uses the formula above to output the difference between Kim Hanyang's Korean and English scores and the difference between his math and inquiry scores. If there are several possible cases, output all of them. Kim Hanyang took Korean, math, English, and inquiry, and did not take the second foreign language. He also received a standard score from to inclusive in every subject.
Input
The first line contains an integer , the student ID.
Output
Print the number of possible cases on the first line.
If there are no possible cases, end the program without further output. If there are, print the difference of the Korean and English standard scores and the difference of the math and inquiry standard scores, separated by a space. Each subject score must be an integer from to inclusive.
If there are several cases, print them in ascending order of the Korean and English difference. If that difference is the same, print them in ascending order of the math and inquiry difference.