Divisibility
Find the number of k-divisible numbers on the segment [a, b]. In other words you need to find the number of such integer values x that a ≤ x ≤ b and x is divisible by k.
Input
The only line contains three space-separated integers k, a and b (1 ≤ k ≤ 1018; - 1018 ≤ a ≤ b ≤ 1018).
Output
Print the required number.
Examples
input
1 1 10
output
10
input
2 -4 4
output
5
#include<cstdio>
int main()
{
long long a,b,pl,ans;
scanf("%lld%lld%lld",&pl,&a,&b);
if(a>=0&&b>0)
{
if(a!=0)
{
ans=b/pl-a/pl;
if(a%pl==0)
ans++;
}
else
ans=b/pl+1;
}
else if(a<0&&b<=0)
{
a=-a;
b=-b;
if(b!=0)
{
ans=a/pl-b/pl;
if(b%pl==0)
ans++;
}
else
ans=a/pl+1;
}
else
{
if(a==0&&b==0)
ans=1;
else
{
a=-a;
ans=b/pl+a/pl+1;
}
}
printf("%lld\n",ans);
return 0;
}