Problem:


Score : 200 points

Problem Statement

You are given nonnegative integers a and b (a ≤ b), and a positive integer x.
Among the integers between a and b, inclusive, how many are divisible by x?

Constraints

0 ≤ a ≤ b ≤ 10^{18}

1 ≤ x ≤ 10^{18}

Input

The input is given from Standard Input in the following format:

a b x

Output

Print the number of the integers between a and b, inclusive, that are divisible by x.

Sample Input 1

4 8 2

Sample Output 1

3

There are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.

Sample Input 2

0 5 1

Sample Output 2

6

There are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.

Sample Input 3

9 9 2

Sample Output 3

0

There are no integer between 9 and 9, inclusive, that is divisible by 2.

Sample Input 4

1 1000000000000000000 3

Sample Output 4

333333333333333333

Watch out for integer overflows.



Sample input:
4 8 2


Sample output:
3

Submission status: Wrong Answer

Solution code:
down,up,num = map(int,input().split())
if down==up :print(0);exit()
print(up//num - down//num + 1 if down % num == 0 and up % num ==0 else up//num - down//num)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

s = b - a // x

if a % x == 0:
    print(s + 1)
else:
    print(s)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
def cal(n, x):
    if n== 0:
        return 0
    else:
        return n // x + 1
print(cal(b, x) - cal(a-1, x))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
def cal(n, x):
    if a == 0:
        return 0
    else:
        return n // x + 1
print(cal(b, x) - cal(a-1, x))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
def cal(n, x):
    if a == 0:
        return 0
    else:
        return n // x + 1
print(cal(b, x) - cal(a, x))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
def cal(n, x):
    if a == 0:
        return 0
    else:
        return n / x + 1
print(str(cal(b, x) - cal(a, x)))

Submission status: Wrong Answer

Solution code:

a, b, x = list(map(int, input().split()))

r = (b-a+1)//x
rm = (b-a+1)%x
if a%x == 0 and rm > 0:
    ans = r+1
elif b%x == 0 and rm > 0:
    ans = r+1
elif b-a+1 < x and (a<=x and b>=x):
    ans = 1
else:
    ans = r

print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))

r = (b-a+1)//x
rm = (b-a+1)%x
if a%x == 0 and rm > 0:
    ans = r+1
elif b%x == 0 and rm > 0:
    ans = r+1
elif b-a+1 < x and (a<=x or b>=x):
    ans = 1
else:
    ans = r

print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))

r = (b-a+1)//x
rm = (b-a+1)%x
if a%x == 0 and rm > 0:
    ans = r+1
elif b%x == 0 and rm > 0:
    ans = r+1
else:
    ans = r

print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))

r = (b-a+1)//x
rm = (b-a+1)%x
if a%x == 0 and rm > 0:
    ans = r+1
else:
    ans = r

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print((b//x - a//x) if a != 0 or b == 0 else b//x - a//x+1)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print(abs(a//x - b//x) if a != 0 else abs(a//x - b//x)+1)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print(abs(a//x - b//x))

Submission status: Wrong Answer

Solution code:
#48b
a,b,x = map(int,input().split())

a=a//x
b=b//x
print(b-a+1)

Submission status: Wrong Answer

Solution code:
#48b
a,b,x = map(int,input().split())
ans=0
a=a//x
b=b//x

if a==0:
    print(b)
elif a==b:
    print(a)
else:
    print(b-a+1)

Submission status: Wrong Answer

Solution code:
#-*-coding:utf-8-*-

def main():
    a, b, x = map(int, input().split())

    start = -(-a // x)
    end = b // x
    if start < end:
        ans = end - start + 1
    else:
        ans = 0
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#-*-coding:utf-8-*-

def main():
    a, b, x = map(int, input().split())

    start = -(-a // x)
    end = b // x
    print(start, end)
    if start < end:
        ans = end - start + 1
    else:
        ans = 0
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#-*-coding:utf-8-*-

def main():
    a, b, x = map(int, input().split())

    start = 0
    end = 0
    for i in range(a, b+1):
        if i % x == 0:
            start = i
            break
    for j in range(b, a-1, -1):
        if j % x == 0:
            end = j
            break
    if (start == 0 and end == 0) or end > start:
        ans = 0
    else:
        ans = (end // x) - (start // x) + 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#-*-coding:utf-8-*-

def main():
    a, b, x = map(int, input().split())

    start = 0
    end = 0
    for i in range(a, b+1):
        if i % x == 0:
            start = i
            break
    for j in range(b, a-1, -1):
        if j % x == 0:
            end = j
            break
    if start == 0 and end == 0:
        ans = 0
    else:
        ans = (end // x) - (start // x) + 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print((b-a)//x+((a%x==0)or(b%x==0)))

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
print((a%x==0)+(b-a)//x)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split(" "))

print((b+0.001)//x-a//x)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split(" "))

print((b+1)//x-a//x)

Submission status: Wrong Answer

Solution code:
from math import floor
a,b,x = map(int, input().split())
na = floor((a-0.1)//x)
nb = b//x
print(nb-na)

Submission status: Wrong Answer

Solution code:

def main():
    a, b, x = map(int,input().split())

    ans=(b - a+1)//x
    amari = (b-a+1)%x

    for i in range(a, a+amari):
        if i % x ==0:
            ans+=1


if __name__ == "__main__":
        main()

Submission status: Wrong Answer

Solution code:

def main():
    a, b, x = map(int,input().split())

    ans=(b - a+1)//x
    amari = ans%x

    for i in range(a, a+amari):
        if i % x ==0:
            ans+=1

    print(ans)

if __name__ == "__main__":
        main()

Submission status: Wrong Answer

Solution code:

def main():
    a, b, x = map(int,input().split())

    ans=(b - a+1)//x
    amari = ans%x

    for i in range(a, a+amari+1):
        if i % x ==0:
            ans+=1

    print(ans)

if __name__ == "__main__":
        main()

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())

f=0

if b%c==0 and a%c==0:
    f+=1

if a==0 and b==0:
    print(1)
elif a==0:
    print(b//c+1)
else:
    print(b//c-(a-1)//c+f)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())

f=0

if b%c==0 and a%c==0:
    f+=1

if a==0 and b==0:
    print(1)
elif a==0:
    print(b//c+1)
else:
    print(b//c-a//c+f)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())

f=0

if b%c==0 and a%c==0:
    f+=1
if a==0 and b>0:
    f+=1

print(b//c-a//c+f)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())

f=0

if b%c==0 and a%c==0:
    f=1

print(b//c-a//c+f)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print(b/x-(a-1)/x)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))

if a == 0 and b == 0:
    print(0)
elif a == 0:
    print(b//x)
elif a%x == 0 and b%x == 0:
    print((b-a)//x+1)
else:
    a_ = ((a//x)+1)*x
    b_ = (b//x)*x
    print((b_-a_)//x+1)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))

if a == 0 and b == 0:
    print(0)
elif a%x == 0 and b%x == 0:
    print((b-a)//x+1)
else:
    a_ = ((a//x)+1)*x
    b_ = (b//x)*x
    print((b_-a_)//x+1)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))

if a%x == 0 and b%x == 0:
    print((b-a)//x+1)
else:
    a_ = ((a//x)+1)*x
    b_ = (b//x)*x
    print((b_-a_)//x+1)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))

if a%x == 0 and b%x == 0:
    print((b-a)//x+1)
else:
    print((b-a)//x)

Submission status: Wrong Answer

Solution code:
s=input().split()
a=int(s[0])
b=int(s[1])
c=int(s[2])
print((b-a)//c+1)

Submission status: Wrong Answer

Solution code:
from math import ceil
a,b,x=map(int, input().split())
ans = ceil((b-a+1)/x)
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int, input().split())
ans = (b-a+1)//x
if a%x==0:ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int, input().split())
ans = (b-a+1)//x
if a%x==0:ans+-1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int, input().split())
print((b-a+1)//x)

Submission status: Wrong Answer

Solution code:
a, b, x = [int(i) for i in input().split()]

ans = len(range(a, b+1, x))
if a % x != 0:
    ans -= 1
    if b % x == 0:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = [int(i) for i in input().split()]

ans = len(range(a, b+1, x))
if a % x != 0:
    ans -= 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
if b - a == 0:
    print(0)
else:
    print((b // x) - (a // x ) + 1)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
if a - b != 0:
    print(int(abs(a - b) / x + 1))
else:
    print(0)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
if a == 0:
    num = int(b / x)
else:
    num = int(b / x) - int((a - 1) / x)
print(num)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
num = int(b / x) - int((a - 1) / x)
print(num)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
num = int(b / x) - int(a / x)
print(num)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
num = int((b - a) / x) + 1
print(num)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
num = (b - a) / x
print(num)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

a, b, x = map(int, input().split())
if a % x == 0 or b % x == 0:
    print((b-a) // x + 1)
else:
    print((b-a) // x)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

a, b, x = map(int, input().split())
if a % x == 0:
    print((b-a) // x + 1)
else:
    print((b-a) // x)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
a, b, x = map(Decimal, input().split())
print(int(b/x - a/x))

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
a, b, x = map(Decimal, input().split())
print(int(Decimal(b/x) - Decimal(a/x)))

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
a, b, x = map(Decimal, input().split())
int(Decimal(b/x) - Decimal(a/x))

Submission status: Wrong Answer

Solution code:
a,b,x = [int(i) for i in input().split(' ')]
ans = b//x - a//x
if b%x==0:
    ans +=1
    """
if a%x==0:
    ans +=1
"""
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
b1 = b // x
a1 = a // x
if a % x == 0:
    a1 += 1
print(b1 - a1)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print(b // x - int((a - 0.1) // x))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

def f(n, x):
    if n >= 0:
        return (n//x) + 1
    else:
        return 0

print(f(b, x) - f(a, x))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

def f(n, x):
    if n >= 0:
        return int(n//x) + 1
    else:
        return 0

print(f(b, x) - f(a, x))

Submission status: Wrong Answer

Solution code:
import math
a, b, x = map(int, input().split())

res = 0    
res += math.floor((b-a)//x)

if a%x == 0:
    res += 1



print(res)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

def f(n, x):
    if n >= 0:
        return int(n/x) + 1
    else:
        return 0

print(f(b, x) - f(a, x))

Submission status: Wrong Answer

Solution code:
import math
a, b, x = map(int, input().split())

res = 0    
res += math.floor((b-a)/x)

if a%x == 0:
    res += 1

if b%x == 0:
    res += 1


print(res)

Submission status: Wrong Answer

Solution code:
import math
a, b, x = map(int, input().split())

res = 0

if a%x == 0:
    res += 1
    
res += math.ceil((b-a)/x)

print(res)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int,input().split())

def func(n, x):
    
    if n == -1:
        num = 0
    else:
        num = -(-n // x)
    return num
if a % x ==0:
    n = 1
else:
    n = 0
print('{}'.format(func(b , x) - func(a - 1,x) + n))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int,input().split())

def func(n, x):
    
    if n == -1:
        num = 0
    else:
        num = -(-n // x)
    return num
print('{}'.format(func(b , x) - func(a - 1,x)))

Submission status: Wrong Answer

Solution code:
import numpy
import re
import math

def main():
	"""
	テストコード実行
	:return:
	"""
	a, b, x = map(int, input().split())
	print((b//x - a//x) if a != 0 else (b//x - a//x) + 1)

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
import numpy
import re
import math

def main():
	"""
	テストコード実行
	:return:
	"""
	a, b, x = map(int, input().split())
	print(((b - a) // x) if a != 0 else ((b - a) // x) + 1)

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
ans = (b - a) // x
if a%x == 0:
    ans += 1
print(int(ans))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
ans = (b - a) // x
if a%2 == 0:
    ans += 1
print(int(ans))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
ans = (b - a) // x
if a%2 == 0:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
answer = b//x-(a-1)//x
if a <= 0:
    answer += 1
print(answer)

Submission status: Wrong Answer

Solution code:
a,b,x = (int(i) for i in input().split())

'''
count = 0
for i in range(a,b+1):
    if i%x==0:
        count = count+1

print(count)


ans = b//x - a//x 
if a//x != 0 or a == 0:
    ans = ans + 1
'''



if a == 0:
    ans = b//x + 1
elif a//x == 0:
    ans = b//x - a//x + 1
else:
    ans = b//x - a//x

print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin

a,b,x = stdin.readline().rstrip().split()
count = 0
a_int = float(a)
b_int = float(b)
x_int = float(x)
count = (b_int / x_int) - (a_int / x_int)
if a_int % x_int == 0:
    count += 1
if abs(a_int - b_int) <= 1:
    count = 0
result = int(count)
print(result)

Submission status: Wrong Answer

Solution code:
from sys import stdin

a,b,x = stdin.readline().rstrip().split()
count = 0
a_int = float(a)
b_int = float(b)
x_int = float(x)
count = (b_int / x_int) - (a_int / x_int)
if a_int % x_int == 0:
    count += 1
if abs(a_int - b_int) <= 1:
    count = 0
result = int(count)

Submission status: Wrong Answer

Solution code:
count = 0
a,b,x = map(int,input().split(' '))
print((b - a + 1) // x)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())

if a%c ==0:
    print(int((b-a)/c)+1)
else:
    print(int((b-a)/c))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split(' '))
num = (b - a) // x
if a % x == 0:
    print(num+1)
else:
    print(num)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int, input().split())
i = a//x
j = b//x
if a%x==0 or b%x==0:
    print(j-i+1)
else:
    print(j-i)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))

if a % x == 0:
    print((b - a) // x + 1)
else:
    print((b - a) // x)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())

k,l = int(a/x),int(b/x)

if a%x==0: k-=1

print(l-k)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int, input().split())
ab = b-a
if ab == 0:
    if a%2==0:
        ans = 1
    else:
        ans = 0
else:
    ans = ab//x
    if a % x == 0:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem B

if __name__ == '__main__':
    a, b, x = list(map(int, input().split()))
    result = (b - a) // x

    if (a == b) and (b >= x) and (b % x == 0):
        print(1)
    elif (a % x != 0) and (b % x != 0):
        print(result)
    else:
        print(result + 1)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem B

if __name__ == '__main__':
    a, b, x = list(map(int, input().split()))

    result = (b - a) // x

    if (a != b) and (b >= x) and ((a % x == 0) or (b % x == 0)):
        result += 1
    elif (a == b == x):
        result += 1
        
    print(result)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem B

if __name__ == '__main__':
    a, b, x = list(map(int, input().split()))

    result = (b - a) // x

    if (a != b) and ((a % x == 0) or (b % x == 0)):
        result += 1

    print(result)

Submission status: Wrong Answer

Solution code:
import sys
from decimal import *
a, b, x =  list(map(int, input().split()))
if((int(b / x) - int(a / x)) == 0):
    print(0)
    sys.exit()
print((int(b / x) - int(a / x)) + 1)

Submission status: Wrong Answer

Solution code:
a, b, x = tuple(map(int, input().split(' ')))

start = int(a / x) if a % x == 0 else int(a / x) + 1
current = start

while current * x <= b:
  current += 1
  
print(current - 1)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
count=0
for i in range(a,b+1,x):
    count+=1
print(count)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split());print(b//x-a//x+a%x==0)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split());print(b//x-a//x+(a%x==0and b%x==0))

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
A = a//x
B = b//x
if a%x ==0 and b%x==0:
  print(B-A+1)
else:
  print(B-A)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
A = a//x
B = b//x
if (B-A) > 0:
  print(B-A+1)
else:
  if a == b and a%x ==0:
    print(1)
  else:
    print(0)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
count=0
for i in range(a,b+1):
  if i%x==0:
    count=+1
print(count)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
print((b-a)//x+1)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print(b//x-a//x+1 if b%x==0 else b//x-a//x)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
if a==0 and b==0:
    print(0)
elif b%x==0 or a%x==0:
    print((b-a)//x+1)
else:
    print((b-a)//x)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
print([(b-a)//x,(b-a)//x+1][b%x==0 or a%x==0])

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
print([(b-a)//x,(b-a)//x+1][b%x==0])

Submission status: Wrong Answer

Solution code:
a, b, x = [int(x) for x in input().split()]
a = a - (a % x) + x if a % x != 0 else a
b = b - b % x if b % x != 0 else b
print(int((b - a) // x + 1)) if b > a else print(0)

Submission status: Wrong Answer

Solution code:
a, b, x = [int(x) for x in input().split()]
a = a - (a % x) + x
b = b - b % x
print(int((b - a) // x + 1)) if b > a else print(0)

Submission status: Wrong Answer

Solution code:
a, b, x = [int(x) for x in input().split()]
a += a % x
b -= b % x
print(int((b - a) / x + 1)) if b > a else print(0)

Submission status: Wrong Answer

Solution code:

a,b,x = map(int, input().split())

u = b // x
l = a // x

print(u - l)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
n=b-(a-1)
if n==-1:
    print(0)
else:
    print(n/(x+1))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print(sum(1 for _ in range(x, b+1, x)))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

a,b,x=list( int(i) for i in input().split() )
count=0

if(a==b and a%x!=0):
    print(0)
elif(a==b and a%x==0):
    print(1)
else:
    if(a%x==0 and (a>=x or x==1)):
        p=1
    else:
        p=0

    print(b//x-a//x+p)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

a,b,x=list( int(i) for i in input().split() )
count=0

if(a==b and a%x!=0):
    print(0)
elif(a==b and a%x==0):
    print(1)
else:
    if(a%x==0 and a!=0):
        p=1
    else:
        p=0

    print(b//x-a//x+p)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

a,b,x=list( int(i) for i in input().split() )
count=0

if(a==b):
    print(0)
else:
    if(a%x==0 and a!=0):
        p=1
    else:
        p=0

    print(b//x-a//x+p)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

a,b,x=list( int(i) for i in input().split() )
count=0

if(a==b):
    print(0)
else:
    if(a%x==0):
        p=1
    else:
        p=0

    print(b//x-a//x+p)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
ans=(b//x+1)-(a//x)
print(ans)

Submission status: Wrong Answer

Solution code:
l = map(int,raw_input().strip().split())
ans = (l[1]-l[0])/l[2]
if l[0]%l[2] == 0:
	ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, raw_input().split())
if a == b:
    print 0
elif a%x == 0 or b%x == 0:
    print (b - a) / x + 1
else:
    print (b - a) / x

Submission status: Wrong Answer

Solution code:
import math
x = input().split(" ")
a = int(x[0])
b = int(x[1])
c = int(x[2])
count = 0
first = 0


for i in range(a,b+1):

    if (0 == i % c):
        first = i
        break
if first:
    print(math.ceil((b+1-first)/c))
else:
    print(0)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, raw_input().split())
if a%x == 0 or b%x == 0:
    print (b - a) / x + 1
else:
    print (b - a) / x

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, raw_input().split())
if x == 1:
    print b - a + 1
else:
    print (b - a) / x

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    A,B,C = map(int, input().split())
    result = B // C
    result -= A // C
    if (A % C == 0):
        result -= 1
    print (result)

Submission status: Wrong Answer

Solution code:
x = input().split(" ")
a = int(x[0])
b = int(x[1])
c = int(x[2])
count = 0
first = 0


for i in range(a,b+1):

    if (0 == i % c):
        first = i
        break
    print(0)
if first:
    print(int((b+1-first)/c + 1))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print( int(b / x) - int((a - 1)/x) )

Submission status: Wrong Answer

Solution code:
input_line = map(int,raw_input().split(" "))
a = input_line[0]
b = input_line[1]
x = input_line[2]

n = b / x
m = a / x

if a == b :
	print 0
elif a == 1:
	print n - m
else:
	print n - m + 1

Submission status: Wrong Answer

Solution code:
import math

a, b, x = map(int, input().split())

aan = math.floor(a / x)
ban = math.floor(b // x)

ans = ban - aan
if a % x == 0:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math

a, b, x = map(int, input().split())

aan = math.floor(a / x)
ban = math.floor(b / x)

ans = ban - aan
if a % x == 0:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if a%c==0:
    d=int(b/c)-int(a/c)+1
else:
    d=int(b/c)-int(a/c)
print(d)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d=abs(b-a)//c
b=a//c
print(b+d)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d=abs(b-a)//c
b=(b%c==0)
print(b+d)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d=abs(b-a)//c
a=(a%c==0)
b=(b%c==0)
print(b+a+d)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
a=abs(b-a)//c
b=(b%c==0)
print(b+a)

Submission status: Wrong Answer

Solution code:
import math
a,b,x = map(int, raw_input().split())

start = int(math.ceil(a * 1.0 / x))
end = b/x
ans = end - start + 1
print ans

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

def f(n1, n2):
    if n1 >= 0:
        return n1//n2
    else:
        return 0

print(f(b,x)-f(a-1,x))

Submission status: Wrong Answer

Solution code:
s = input().split()
a = int(s[0])
b = int(s[1])
x = int(s[2])

def f(n1, n2):
    o = int(n1/n2)
    if o <0:
        o = 0
    return o
    
print(f(b,x)-f(a-1,x))

Submission status: Wrong Answer

Solution code:
s = input().split()
a = int(s[0])
b = int(s[1])
x = int(s[2])

d = int(b/x) - int((a-1)/x) 

print(d)

Submission status: Wrong Answer

Solution code:
a, b, x = [float(i) for i in input().split()]
count = 0

s = (a - 1) // x
if s < 0 : s = 0
e = b // x

count = e - s

print(int(count))

Submission status: Wrong Answer

Solution code:
a, b, x = [float(i) for i in input().split()]
count = 0

if a != 0:
    s = (a - 1) // x
else:
    s = 0

e = b // x

count = e - s

print(int(count))

Submission status: Wrong Answer

Solution code:
a, b, x = [float(i) for i in input().split()]
count = 0

if a >= x :
    s = (a - 1) // x
else:
    s = 0

e = b // x

count = e - s

print(int(count))

Submission status: Wrong Answer

Solution code:
a, b, x = [float(i) for i in input().split()]
count = 0

s = (a - 1) // x
e = b // x

count = e - s

print(int(count))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

if a is 0:
    result = b//x
else:
    result = b//x - (a-1)//x


print(result)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

result = 0
if a is 0:
    result = 1
result += b//x - (a-1)//x

print(result)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

result = 0
if a is 0:
    result = 1

result += (b-a)//x

print(result)

Submission status: Wrong Answer

Solution code:
A, B, X = list(map(int, input().split()))
C = (int(A/X)+(1 if A%X else 0))*X
if B < C:
	print(0)
else:
	print(1+int((B-C)/X))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
if a == 0:
    b += x
print(b // x - a // x)

Submission status: Wrong Answer

Solution code:
a, b, x = [int(n) for n in input().split()]

qa = int(a / x)
qb = int(b / x)
ra = a % x
rb = b % x

res = qb - qa
if ra == 0:
    res += 1

print(res)

Submission status: Wrong Answer

Solution code:
a, b, x = [int(n) for n in input().split()]

qa = a / x
qb = b / x
ra = a % x
rb = b % x

res = qb - qa
if ra == 0:
    res += 1

print(res)

Submission status: Wrong Answer

Solution code:
a, b, x = [int(n) for n in input().split()]



print((b-a+1)/x)

Submission status: Wrong Answer

Solution code:
a, b, x = [int(n) for n in input().split()]

res = 0

print((b-a+1)%x)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
l = b - a + 1
ans = l // x + len([i for i in range(a, a+l%x) if i % x == 0])
print(x, (a, b), ans)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
import math
import sys
a, b, x = map(int,input().split())

if a == b:
    if a%x == 0:
        print(1)
    else:
        print(0)
    sys.exit()

ans= math.floor(b / x) - math.floor(a / x) + 1
print(ans)

"""
for tmp in range (a, b+1):
    if tmp % x == 0:
        ans += 1
"""

Submission status: Wrong Answer

Solution code:
a, b, x = map(int,input().split())
N = 0
for i in range(a, b+1):
    if i % x == 0:
        break
N = int((b-i)//x)+1
print(N)

Submission status: Wrong Answer

Solution code:
import sys

a, b, x = map(int, input().split())

if b == 0:
    print(0)
    sys.exit(0)
if a == 0:
    a += 1

counter = (b - a + 1) // x
for i in range((b - a + 1) % x):
    if (a + i) % x == 0:
        counter += 1
print(counter)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, raw_input().split())
if a != b:
    print ((b-a) / c) + int(a%c == 0 or b%c == 0)
else:
    print int(a%c == 0)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, raw_input().split())
if a != b:
    print ((b-a) / c) + int(a%c == 0 and b%c == 0)
else:
    print int(a%c == 0)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print ((b // x) - (a // x))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
ans = 0
if ((not a % x) or (not b % x)) and (a - b + 1) % x:
	ans += 1
ans += (b - a + 1) // x
print(ans)

Submission status: Wrong Answer

Solution code:
a, b , x = map(int, input().split())
ans = 0
if (not a % x) or (not b % x):
	ans += 1
ans += (b - a) // x
print(ans)

Submission status: Wrong Answer

Solution code:
a, b , x = map(int, input().split())
ans = 0
if not a % x or not b % x:
	ans += 1
ans += (b - a) // x
print(ans)

Submission status: Wrong Answer

Solution code:
a, b , x = map(int, input().split())
ans = 0
if not a % x:
	ans += 1
ans += (b - a) // x
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-

a, b, x = map(int, input().split())

count = 0

for i in range(a, b+1, x):
    if i % x == 0:
        count = count + 1

print(count)

Submission status: Wrong Answer

Solution code:
a, b, x= map(int, raw_input().split())
if a%3 == 0:
    print b//x - a//x +1
else:
    print  b//x - a//x

Submission status: Wrong Answer

Solution code:
#ABC048B

a,b,x=map(int,raw_input().split())
u=b/x
v=a/x
if b!=0 and a==0:
 print u-v+1
elif b==0 and a==0:
 print 1
else:
 print u-v

Submission status: Wrong Answer

Solution code:
a, b, x= map(int, raw_input().split())
m = (b-a)//x
if a%x == 0 or b%x == 0:
    print m+1
else:
    print m

Submission status: Wrong Answer

Solution code:
a,b,x = list(map(int, input().split()))
print((b//x)-(a//x))

Submission status: Wrong Answer

Solution code:
a,b,x = list(map(int, input().split()))
print((b-a+1)//x)

Submission status: Wrong Answer

Solution code:
a,b,x = list(map(int, input().split()))
print(1+(b-a)//x)

Submission status: Wrong Answer

Solution code:
n=input().split(" ")
a=int(n[0])
b=int(n[1])
x=int(n[2])

if a%x!=0:
    a+=x-(a%x)
b=b-(b%x)

if b<a:
    print(0)
else:
    print(int(((b-a)/x)+1))

Submission status: Wrong Answer

Solution code:
n=input().split(" ")
a=int(n[0])
b=int(n[1])
x=int(n[2])

if a%x!=0:
    a+=x-a%x
b-=b%x

if b<a:
    print(0)
else:
    print(((b-a)/x)+1)

Submission status: Wrong Answer

Solution code:
import math
a, b, x = map(int, input().split())
A = math.floor(a / x)
B = math.floor(b / x)
count = B - A + (a % x == 0)
print(count)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())

print((b - a) / c)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())

d = 0
if a == 0:
    d = 1

print(int((b - a) / c + d))

Submission status: Wrong Answer

Solution code:
#coding: UTF-8

import math


if __name__ == "__main__":
	data = list(map(int,input().split()))
	a = data[0]
	b = data[1]
	x = data[2]
	if a%x == 0:
		print((data[1]-data[0])//data[2]+1)
	else:
		if x > b:
			print("0")
		else: 
			if x < a:
				print((data[1]-data[0])//data[2])
			else:
				print((data[1]-data[2])//data[2]+1)