2230: 糖果
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
给定正整数区间[L,R]和正整数n,满足n<=L<=R。有一正整数变量K,L<=K<=R。求当K取多少时,K模n的值最大,输出这个最大值。
Input
从文件candy.in读入数据。
输入一行三个正整数n、L、R。
Output
输出到文件candy.out中。
按要求输出结果。
Sample Input Copy
7 16 23
Sample Output Copy
6
HINT
样例输入2
10 14 18
样例输出2
8
数据范围
对于100%的数据,2<=n<=L<=R<=$10^9$.