#24Easy
Day of the week
Time: 1 s · Memory: 256 MB
- Arithmetic
Statement
The days of the week are numbered as follows: 1 — Monday, 2 — Tuesday, 3 — Wednesday, 4 — Thursday, 5 — Friday, 6 — Saturday, 7 — Sunday.
January 1 is day of the week. Find which day of the week the -th day of the year is.
Input format
A single line with two integers and (, ).
Output format
A single integer from to — the day of the week for day .
Examples
Input
1 1
Output
1
Input
3 100
Output
4
Note
The day of the week repeats every 7 days, so you need the remainder modulo . Numbering starts at , not , so subtract first and add it back at the end: .
