Skip to content

Instantly share code, notes, and snippets.

@02015678
Created January 23, 2015 13:20
Show Gist options
  • Save 02015678/a23faae4d1a59e827ff3 to your computer and use it in GitHub Desktop.
Save 02015678/a23faae4d1a59e827ff3 to your computer and use it in GitHub Desktop.
NK1002 NKPC1 Lucy's Problem
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