Brsil Comet
Time limit1sMemory limit1024 MB
Given a date on a 360-day calendar and a period N, the task is to find the next date after today that is a multiple of N days later.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Brsil, an idol from Brsil Cup, appeared like a comet, and people from all over the country gathered at the observatory to see her. The nickname "appeared like a comet" comes from the fact that Brsil can be observed periodically, like a comet. Given that Brsil can be seen today, find the earliest date on which Brsil can be seen again.
For convenience, assume that a month has days and a year has months (that is, a year has days).
Input
The first line contains today's date in the form yyyy-mm-dd. yyyy ; mm ; dd .
The second line contains an integer . This means Brsil can be observed every days. .
Output
Print the earliest date after today on which Brsil can be seen, in the form yyyy-mm-dd.