Logo
(追記) (追記ここまで)

25774번 - Simplified Calendar System 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB31724020874.820%

문제

Consider a simplified calendar system where each year is 12 months and each month is 30 days, i.e., each year is 360 days. This sure makes the math easy, or does it?

Given a date and what day of the week it is, determine what day of the week a second date is. The second date will be after (timewise) the first date.

입력

There are two input lines. The first input line contains four integers:

  • d (1 ≤ d ≤ 30), providing what day of the month the first date is,
  • m (1 ≤ m ≤ 12), providing what month of the year the first date is,
  • y (1000 ≤ y ≤ 2999), providing what year the first date is, and
  • n (1 ≤ n ≤ 7), providing what day of the week the given date is (1 represents Sunday, 2 represents Monday, …, 7 represents Saturday).

The second input line provides the second date; it contains three integers (similar to the first three integers of the first input line). Again, the second date will be later than the first date (timewise).

출력

Print an integer (between 1 and 7, inclusive) indicating what day of the week the second date is.

제한

예제 입력 1

20 11 2021 7
29 11 2021

예제 출력 1

2

예제 입력 2

20 10 1999 5
15 4 2002

예제 출력 2

4

힌트

출처

University > University of Central Florida > 2022 Local Programming Contest (Final Round) 2번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /