#Lutece2844. Senpai and Pascal
Senpai and Pascal
Migrated from Lutece 2844 Senpai and Pascal
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Kanade regards Pascal users as her senpais. Because all her senpais use Pascal. Although she is a C++ user.
One day, she was confused by a problem. Finally, she found the code which had passed this problem written by her senpai. Of course, this code is written by Pascal.
program calc;
var
i, j, l, r, ans: int64;
begin
ans := 0;
read(l);
read(r);
i := l;
while i <= r do begin
j := l;
while j <= r do begin
if (i or j) > ans then
ans := i or j;
inc(j);
end;
inc(i);
end;
writeln(ans);
end.
Some facts in Pascal which may be useful:
i or j
means the bitwise OR of and ;inc(x)
means , and it's the same as++x
in C++;read(x)
means read from the standard input,writeln(x)
means write to the standard output (and a newline, but it's not important);int64
in Pascal is same aslong long
in C++.
Because of the weak data, the code passed all the test cases. Kanade made some stronger data, but she didn't know whether these data is valid. Please write a program that outputs the same answer for the same input as the Pascal code will. So that Kanade can check her code.
Input
There is only one line in the input. The first line contains two integer .
Output
Output one integer in a line, indicating the answer which the Pascal code will output.
Samples
114 514
1023
Resources
The 18th UESTC Programming Contest Preliminary