Easter Sunday P32323


Statement
 

pdf   zip

Write a program that prints which day is Easter Sunday of a given year (remember that Easter Sunday is a mobile holiday that corresponds to the first Sunday after the first full moon of the spring.

To solve this problem, use the Gauss method. The Gauss method to find the day (DD) and the month (MM) that corresponds to the Easter Sunday of a year (YY) is:

  • Is computed ( indicates integer division and indicates the remainder of the integer division):

    1. k:=Ydiv100k := Y~\text{div}~100

    2. y:=Ymod19y := Y ~\text{mod}~ 19

    3. b:=Ymod4b := Y ~\text{mod}~ 4

    4. c:=Ymod7c := Y ~\text{mod}~ 7

    5. q:=kdiv4q := k~\text{div}~4

    6. p:=(13+8k)div25p := (13+8k)~\text{div}~25

    7. m:=(15p+kq)mod30m := (15-p+k-q) ~\text{mod}~ 30

    8. d:=(19y+m)mod30d := (19y + m) ~\text{mod}~ 30

    9. n:=(4+kq)mod7n := (4+k-q) ~\text{mod}~ 7

    10. e:=(2b+4c+6d+n)mod7e := (2b+4c+6d+n) ~\text{mod}~7

  • When d+e9d+e \le 9, then D:=22+d+eD := 22+d+e and M:=3M := 3.

  • When d=29d=29 and e=6e=6, then D:=19D := 19 and M:=4M := 4.

  • When d=28d=28 and e=6e=6 and y>10y>10, then D:=18D := 18 and M:=4M := 4.

  • Otherwise, D:=d+e9D := d+e-9 and M:=4M := 4.

Input

Input is a year (integer number) between 1800 and 9999.

Output

The output is two integer numbers in a line, separated by a slash. The first is the day and the second is the month which correspond to the Easter Sunday of the given year using Gauss method.

Public test cases
  • Input

    2006
    

    Output

    16/4
    
  • Input

    1999
    

    Output

    4/4
    
  • Information
    Author
    Jordi Petit
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Pascal
    User solutions
    C++ Python