Input

J, integer
K, integer 
I, 4-digit integer

Interface

          |  |  | 
JulianDay(J, K, I) 
    |

Process

BEGIN 
  A <- (14 - J) div 12
  Y <- I + 4800 - A
  M <- J + 12 * A - 3
  R <- (153 * M + 2) div 5
  L <- Y div 4 - Y div 100 + Y div 400
  N <- K + R + 365 * Y + L - 32045
  JulianDay <- N 
END 
meatgrinder

Output

JulianDay, long integer 

Notes

Determines a unique, seven-digit integer corresponding to the given date.
J is month, K is day of month and I is 4-digit year. The algorithm is based on description in Wikipedia.

Examples

Input                    Output 
J       K       I        JulianDate 
1       21      1988     2447182 
10      9       1995     2450000 
10      9       1943     2431007 
9       10      1935     2428056 

Notation

<- means is replaced by 
J div K yields the quotient after long division of J by K 
J mod K yields the remainder after long division of J by K