JDCC '17 Contest 2 S1 - Advent Calendar

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Problem type

Advent calendars are calendars which usually start on December 1st, end on December 25th, and contain a piece of chocolate for every date in the calendar. The calendar serves as a countdown to Christmas, however there is no reason that they should start on December 1st.

Given a starting date for the advent calendar, how many pieces of chocolate would it have?


The input consists of one line containing the starting date of the advent calendar. The date is represented by a string representing the month followed by an integer representing the day of the month. The date is guaranteed to be valid and before December 25th.


Output how many chocolate pieces the advent calendar would contain.

Sample Input 1

December 1

Sample Output 1


Sample Input 2

October 31

Sample Output 2



There are no comments at the moment.