Problem G
Leap Year Problem
Problem Statement:
A leap year
is a year containing one more extra days in order to keeps the calendar year
synchronized with the astronomical or seasonal year. For example, in the Gregorian calendar,
February in a leap year has 29 days instead of the usual 28 so the year lasts
366 days instead of the usual 365.
On the other
hand in Bangla calendar, Bengali year is always 593 less than the year in the
Gregorian calendar, i.e. Gregorian calendar 2009 is the 1416 in Bangla
calendar. To keep pace with the Gregorian calendar, the Bengali calendar also
maintains leap year and those years are the leap year whose corresponding
Gregorian calendar year is counted as a leap year. For example, Falgun 1411 is
considered a Bengali leap month, as it fell during the Gregorian leap month of
February 2004. According to the calendar system in Bangladesh, Falgun (which begins
mid-February) has 31 days after every four years.
Fahim is a
student of BUBT in CSE department who born in 29th February 1984 face a big
problem to celebrate his birthday. Only after four year he can enjoy his
birthday. So, he take a dissection that he will celebrate his birthday in
Bangla year which is 17th Falgun. It also introduces a very silly
problem that in Gregorian calendar 17th Falgun may be 29th
February or 1st March base on leap year and all the people accustom
to Gregorian calendar.
Input
The input file will contain a single integer N (0
<= N <= 65767) in each line representing the Bangla year (by
default day is17th Falgun). A negative number terminates the input.
Output:
Equivalent
date and year in Gregorian calendar.
Each line should contain only one output integer without any leading or
trailing space.
Sample Input:
1406
1490
1560
-10
Sample Output:
29 th February 2000
29 th February 2084
1 st March 2154
No comments:
Post a Comment