Born in 1998, but 2541 in Thailand?!
InterviewTime limit1sMemory limit1024 MB
Given a Buddhist calendar year between 1000 and 3000, print the corresponding Gregorian year by subtracting 543.
- Level
Easy1 of 10
- Topics
- Math, Implementation, Brute force, Recursion
- Solved
- No attempts yet
Problem
Team Redshift had just arrived at Suvarnabhumi International Airport to take part in the ICPC Bangkok Regional when they could not believe their eyes. The large screen at the airport said the current year was 2562.
Thailand, a Buddhist country, uses the Buddhist calendar, which counts years from the year of Buddha's parinirvana. Korea, on the other hand, uses the Gregorian calendar. Given a Buddhist calendar year, write a program that converts it to a Gregorian calendar year.
Input
A Buddhist calendar year y to convert is given. (1000 ≤ y ≤ 3000)
Output
Print the result of converting the Buddhist calendar year to a Gregorian calendar year.