Created
January 23, 2015 13:20
-
-
Save 02015678/a23faae4d1a59e827ff3 to your computer and use it in GitHub Desktop.
NK1002 NKPC1 Lucy's Problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Var | |
x:array[1..15]OF longint; | |
i,n:integer; | |
Function cal(x:longint):longint; | |
Begin | |
IF x>=50025002 | |
THEN cal:=x-5 | |
ELSE | |
Begin | |
repeat | |
inc(x,2000); | |
until x>=50025002; | |
cal:=x-5 | |
End; | |
End; | |
Begin | |
i:=0; | |
repeat inc(i); readln(x[i]);until eof(input); | |
For n:=1 to i do writeln(cal(x[n])); | |
End. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment