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:
a,b,x = map(int,input().split())
if b<x:
	print(0)
	exit()
elif (a+b)/2<x<=b:
	print(1)
	exit()
for i in range(b,a-1,-1):
	if i%x==0:
		byori=i
		break
else:
	print(0)
	exit()
for j in range(a,b+1):
	if j%x==0:
		ayori=j
		break
else:
	print(0)
	exit()
ans =(byori-ayori)//x+1
print(ans)

Submission status: Wrong Answer

Solution code:
A, B, X = map(int, input().split())
print((B - A) // X)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

li=list(map(int,input().split()))	
min=li[0]//li[2]
max=li[1]//li[2]
count=max-min
if li[0]/li[2]==0:
  count+=1
print(count)

Submission status: Wrong Answer

Solution code:

li=list(map(int,input().split()))	
min=li[0]//li[2]
max=li[1]//li[2]
count=max-min
if li[0]==0:
  count+=1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 0
i = 0
min_bai = math.ceil(a/x)  # xの倍数で最小
max_bai = math.floor(b/x)  # xの倍数で最大
x_bai = max_bai - min_bai + 1

print(x_bai)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0

s = []
i = 1
while True:
    if x*i > b:
        break
    if x*i >= a and x*i <= b:
        s.append(x*i)
    i += 1

print(len(s))

Submission status: Wrong Answer

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

cnt = 0

num = [i for i in range(a,b+1)]
s = [x]
i = 1
while True:
    if s[i-1] > b:
        break
    s.append(x*i)
    i += 1

cons = list(set(num) & set(s))

print(len(cons))

Submission status: Wrong Answer

Solution code:
# Between a and b ...

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

Submission status: Wrong Answer

Solution code:
# Between a and b ...

a, b, x = map(int, input().split())
c = a // x
if x == 1:
    ans = (b // x) - (a // x) + 1
elif x >= 2 and c == 0:
    ans = (b // x) - (a // x)
elif x >= 2 and c >= 1:
    ans = (b // x) - (a // x) + 1
else:
    ans = (b // x) - (a // x)
print(ans)

Submission status: Wrong Answer

Solution code:
# Between a and b ...

a, b, x = map(int, input().split())
c = a // x
if x == 1 and c == 0:
    ans = (b // x) - (a // x) + 1
elif x >= 2 and c == 0:
    ans = (b // x) - (a // x)
elif x >= 2 and c >= 1:
    ans = (b // x) - (a // x) + 1
else:
    ans = (b // x) - (a // x)
print(ans)

Submission status: Wrong Answer

Solution code:
# Between a and b ...

a, b, x = map(int, input().split())
c = a // x
print(c)
if x == 1 and c == 0:
    ans = (b // x) - (a // x) + 1
elif x >= 2 and c == 0:
    ans = (b // x) - (a // x)
elif x >= 2 and c >= 1:
    ans = (b // x) - (a // x) + 1
else:
    ans = (b // x) - (a // x)
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# Between a and b ...

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

if a % x == 0:
    for i in range(a, b+1, x):
        count.append(i)
else:
    c = a % x
    a = a + c
    for k in range(a, b+1, x):
        count.append(k)


print(len(count))

Submission status: Wrong Answer

Solution code:
# Between a and b ...

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

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


print(count)

Submission status: Wrong Answer

Solution code:
# Between a and b ...

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

if a % x == 0:
    for i in range(a, b+1, x):
        if i % x == 0:
            count = count +1
        else:
            pass
else:
    c = a % x
    a = a + 1
    for k in range(a, b+1, x):
        if k % x == 0:
            count = count +1
        else:
            pass
        
print(count)

Submission status: Wrong Answer

Solution code:
# Between a and b ...

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

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


print(count)

Submission status: Wrong Answer

Solution code:
# Between a and b ...

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

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

Submission status: Wrong Answer

Solution code:
# ABC48, B - between a and b
import itertools
a, b, x = [int(el) for el in input().split(' ')]
if a % x == 0:
    print((b-a + 1) // x + 1)
else:
    print((b-a + 1) // x)

Submission status: Wrong Answer

Solution code:
# ABC48, B - between a and b
import itertools
a, b, x = [int(el) for el in input().split(' ')]
if a % x == 0:
    print((b-a + 1) // x)
else:
    print((b-a + 1) // x)

Submission status: Wrong Answer

Solution code:
def solve():
    a, b, x = map(int, input().split())
    if a == 0 or b == 0:
        return 0
    return b // x - (a - 1) // x


if __name__ == "__main__":
    print(solve())

Submission status: Wrong Answer

Solution code:
#ABC048B

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

count = 0
if x>b:
    count = 0
else:
    count_b = b//x
    if a ==0:
        count_a =-1
    elif a%x ==0:
        count_a = a//x -1
    else:
        count_a = a//x
    count = count_b- count_a

print(count)

Submission status: Wrong Answer

Solution code:
#ABC048B

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

count = 0
if x>b:
    count = 0
else:
    count_b = b//x
    if a%x ==0:
        count_a = a//x -1
    else:
        count_a = a//x
    count = count_b- count_a

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve():
    a, b, x = read()
    result = think(a, b, x)
    write(result)


def read():
    return read_int(3)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a, b, x):
    return count_integers_divided_by_x_num_from_zero_to(b, x) - count_integers_divided_by_x_num_from_zero_to(a - 1, x)


def count_integers_divided_by_x_num_from_zero_to(i, x):
    if i == -1:
        return 0
    integers = i // x + 1
    if i % x == 1:
        integers += 1
    return integers


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
def solve():
    a, b, x = read()
    result = think(a, b, x)
    write(result)


def read():
    return read_int(3)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a, b, x):
    return count_integers_divided_by_x_num_from_zero_to(b, x) - count_integers_divided_by_x_num_from_zero_to(a - 1, x)


def count_integers_divided_by_x_num_from_zero_to(i, x):
    if i == 0:
        return -1
    integers = i // x + 1
    if i % x == 1:
        integers += 1
    return integers


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
def solve():
    a, b, x = read()
    result = think(a, b, x)
    write(result)


def read():
    return read_int(3)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a, b, x):
    return count_integers_divided_by_x_num_from_zero_to(b, x) - count_integers_divided_by_x_num_from_zero_to(a - 1, x)


def count_integers_divided_by_x_num_from_zero_to(i, x):
    integers = i // x + 1
    if i % x == 1:
        integers += 1
    return integers


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
def solve():
    a, b, x = read()
    result = think(a, b, x)
    write(result)


def read():
    return read_int(3)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a, b, x):
    return count_integers_divided_by_x_num_from_zero_to(b, x) - count_integers_divided_by_x_num_from_zero_to(a - 1, x)


def count_integers_divided_by_x_num_from_zero_to(i, x):
    integers = i // x
    if i % x == 1:
        integers += 1
    return integers


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
def solve():
    a, b, x = read()
    result = think(a, b, x)
    write(result)


def read():
    return read_int(3)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a, b, x):
    result = (b - a) // x
    if a % x == 0 or b % x == 0:
        result += 1
    return result


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
def solve():
    a, b, x = read()
    result = think(a, b, x)
    write(result)


def read():
    return read_int(3)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a, b, x):
    result = (b - a) // x
    if a % x == 0:
        result += 1
    return result


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
import itertools
import math
a,b,x  =list(map(int,input().split(" ")))
diva  = (a)//x
divb = (b )//x
ans = divb -diva
if a % x == 0 and b % x == 0:
    ans += 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
a,b,x=[int(x) for x in input().split()]
if b<x:
  if b==0 or a==0:
    print(1)
  else:
    print(0)
elif a==0:
  print(b//x+1)
elif a<=x:
  print(b//x)
else:
  print(b//x-math.ceil(a/x)+1)

Submission status: Wrong Answer

Solution code:
import math
a,b,x=[int(x) for x in input().split()]
if b<x:
  if b==0 or a==0:
    print(1)
  else:
    print(0)
elif a==0:
  print(b//x+1)
elif a<x:
  print(b//x)
else:
  print(b//x-math.ceil(a/x)+1)

Submission status: Wrong Answer

Solution code:
import math
a,b,x=[int(x) for x in input().split()]
if b<x:
  if b==0:
    print(1)
  else:
    print(0)
elif a==0:
  print(b//x+1)
elif a<x:
  print(b//x)
else:
  print(b//x-math.ceil(a/x)+1)

Submission status: Wrong Answer

Solution code:
import math
a,b,x=[int(x) for x in input().split()]
if b<x:
  print(0)
elif a==0:
  print(b//x+1)
elif a<x:
  print(b//x)
else:
  print(b//x-math.ceil(a/x)+1)

Submission status: Wrong Answer

Solution code:
import math
a,b,x=[int(x) for x in input().split()]
if b<x:
  print(0)
elif a<x:
  print(b//x)
else:
  print(b//x-math.ceil(a/x)+1)

Submission status: Wrong Answer

Solution code:
import math
a,b,x=[int(x) for x in input().split()]
print(math.floor(b/x)-math.ceil(a/x)+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
import math
def func(n):
    if n >=0:
        return math.floor(n/x)+1
    if n ==-1:
        return 0
print(func(b)-func(a-1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#ABC048b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

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

Submission status: Wrong Answer

Solution code:
#ABC048b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

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

Submission status: Wrong Answer

Solution code:
#ABC048b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import sys

sys.setrecursionlimit(10**7)

# Override `input` function because `stdin.readline()` is 10x faster than built-in `input()`
input = sys.stdin.readline


def read_h(typ=int):
    return list(map(typ, input().split()))


def read_v(n, m=1, typ=int):
    return [read_h(typ) if m > 1 else typ(input()) for _ in range(n)]


def main():
    a, b, x = read_h()
    ans = (b - a) // x + (1 if a % x == 0 else 0)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

a,op,b=map(str,input().split())
if op=="+":
  suma=int(a)+int(b)
  print(suma)
elif op=="-":
  resta=int(a)-int(b)
  print(resta)

Submission status: Wrong Answer

Solution code:

b=0
arr=[]
posibles=0
a,b,x=map(int,input().split())
if b>a:
  p=a
  arr.append(p)
  while True:
    p+=1 
    arr.append(p)
    if p==b:
      break
if a==1 and b==1 and x==1:
  posibles=1
elif a==b:
  division=str(a/x)  
  posicion2=division.index('.')+1
  for i in range(len(division)-posicion2):
    if int(division[posicion2+i])==0:
      pass
    else:
      b=1
      break
  if b==1:
    pass
  else:
    posibles+=1  
else:  
  for i in arr:
    division=str(i/x)  
    posicion2=division.index('.')+1
    
    for o in range(len(division)-posicion2):
      if int(division[posicion2+o])==0:
        pass
      else:
        b=1
        break
    if b==1:
      b=0
    else:
      posibles+=1
print(posibles)

Submission status: Wrong Answer

Solution code:

b=0
arr=[]
posibles=0
a,b,x=map(int,input().split())
if b>a:
  p=a
  arr.append(p)
  while True:
    p+=1 
    arr.append(p)
    if p==b:
      break
if a==b:
  division=str(a/x)  
  posicion2=division.index('.')+1
  for i in range(len(division)-posicion2):
    if int(division[posicion2+i])==0:
      pass
    else:
      b=1
      break
  if b==1:
    pass
  else:
    posibles+=1  
else:  
  for i in arr:
    division=str(i/x)  
    posicion2=division.index('.')+1
    
    for o in range(len(division)-posicion2):
      if int(division[posicion2+o])==0:
        pass
      else:
        b=1
        break
    if b==1:
      b=0
    else:
      posibles+=1
print(posibles)

Submission status: Wrong Answer

Solution code:
row = list(map(int, input().split()))

def func(n):
    if n < 0:
        f = 0
    else:
        f = n//row[2]+1
    return f

print(func(row[1])-func(row[0]+1))

Submission status: Wrong Answer

Solution code:
row = list(map(int, input().split()))
start = 1
end = 0
for i in range(row[0], row[1]+1):
    if i % row[2] == 0:
        start = int(i / row[2])
        break
for i in reversed(range(row[0], row[1]+1)):
    if i % row[2] == 0:
        end = int(i / row[2])
        break
print(end-start+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
a,b,x = [int(x) for x in stdin.readline().rstrip().split()]
print((b-a) // x )

Submission status: Wrong Answer

Solution code:
from sys import stdin
a,b,x = [int(x) for x in stdin.readline().rstrip().split()]
print((b // x) - (a // x) + 1)

Submission status: Wrong Answer

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

    b_count = (b // x) + 1
    if a <= x:
        a_count = 1
    else:
        a_count = ((a - 1) // x) + 1
    print(b_count - a_count)

    # mod = [i for i in range(a, b + 1) if i % x == 0]
    # print(len(mod))

if __name__ == "__main__":

    main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

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:
a,b,x=map(int,input().split())
ta=(a-1)//x+1 if a>0 else 0
tb=b//x+1 if b>0 else 0
print(tb-ta)

Submission status: Wrong Answer

Solution code:
import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18

A, B, X = list(map(Decimal, sys.stdin.readline().split()))

if A == B == 0:
    print(0)
else:
    print(math.floor(B / X) - math.ceil(A / X) + 1)

Submission status: Wrong Answer

Solution code:
import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18

# W, H, N = list(map(int, sys.stdin.readline().split()))
# X, Y, A = list(zip(*[map(int, sys.stdin.readline().split()) for _ in range(N)]))
#
# board = np.ones((W, H), dtype=bool)
# for x, y, a in zip(X, Y, A):
#     if a == 1:
#         board[:x, :] = 0
#     if a == 2:
#         board[x:, :] = 0
#     if a == 3:
#         board[:, :y] = 0
#     if a == 4:
#         board[:, y:] = 0
# print(board.sum())

A, B, X = list(map(Decimal, sys.stdin.readline().split()))

print(max(0, B // X - (A - 1) // X))

Submission status: Wrong Answer

Solution code:
import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18

# W, H, N = list(map(int, sys.stdin.readline().split()))
# X, Y, A = list(zip(*[map(int, sys.stdin.readline().split()) for _ in range(N)]))
#
# board = np.ones((W, H), dtype=bool)
# for x, y, a in zip(X, Y, A):
#     if a == 1:
#         board[:x, :] = 0
#     if a == 2:
#         board[x:, :] = 0
#     if a == 3:
#         board[:, :y] = 0
#     if a == 4:
#         board[:, y:] = 0
# print(board.sum())

A, B, X = list(map(Decimal, sys.stdin.readline().split()))

print(B // X - (A - 1) // X)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil

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

l = ceil(a / x)
r = b // x

print(int(r - l + 1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil

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

l = ceil(a / x)
r = b // x

print(r - l + 1)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
 
can = True
 
if x < a:
    S = ((a+x-1) // x) * x
else:
    S = x
 
if b < x:
    can = False
else:
    L = (b // x) * x
 
if not can:
    print(int(0))
elif a == b and a % x == 0:
	print(int(1))
elif L >= S:
    if a == 0:
        print(int((L-S) // x + 2))
    else:
        print(int((L-S) // x + 1))
else:
    print(int(0))

Submission status: Wrong Answer

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

can = True

if x < a:
    S = ((a+x-1) // x) * x
else:
    S = x

if b < x:
    can = False
else:
    L = (b // x) * x

if not can:
    print(int(0))
elif L >= S:
    if a == 0 or a == x:
        print(int((L-S) // x + 2))
    else:
        print(int((L-S) // x + 1))
else:
    print(int(0))

Submission status: Wrong Answer

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

can = True

if x < a:
    S = ((a+x-1) // x) * x
else:
    S = x

if b < x:
    can = False
else:
    L = (b // x) * x

if not can:
    print(int(0))
elif L >= S:
    if a == 0:
        print(int((L-S) // x + 2))
    else:
        print(int((L-S) // x + 1))
else:
    print(int(0))

Submission status: Wrong Answer

Solution code:
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:
a, b, x = map(int, input().split())
if (a % x == 0) or (b % x == 0):
    print(b // x + a // x + 1)
else:
    print(b // x + a // x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

sub = b - a

ans = 0
if a % x == 0:
    ans += 1
#print(sub//x)
ans += sub // x
print(ans)

Submission status: Wrong Answer

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

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

sub = b - a

ans = 0
if a % x == 0 or b % x == 0:
    ans += 1
#print(sub//x)
ans += sub // x
print(ans)

Submission status: Wrong Answer

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

    st = math.ceil(a / x)
    ed = b // x
    print(ed - st + 1)


abc()

Submission status: Wrong Answer

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

    st = math.ceil(a / x)
    ed = math.floor(b / x)

    print(ed - st + 1)


abc()

Submission status: Wrong Answer

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

    st = math.ceil(a / x) * x
    ed = math.floor(b / x) * x

    print((ed - st) // x + 1)


abc()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if a%x ==0:
  p=a
else:
  p = a + (x - a%x)
q = b - b%x

if p > q:
  n = 0
else:
  n = (q-p)/x +1

print(n)

Submission status: Wrong Answer

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

if a%x ==0:
  p=a
else:
  p = a + (x - a%x)
q = b - b%x

if p > b:
  n = 0
else:
  n = (q-p)/x +1

print(n)

Submission status: Wrong Answer

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

n = 0
p = 0
q = 0

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

for j in reversed(range(a, b+1)):
  if j%x == 0:
    q = j
    break

if p != 0:
  n = (q - p)/x +1

print(n)

Submission status: Wrong Answer

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

while p < b:
  p += x
  n += 1

if p != 0:
  n -= 1

print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

Solution code:
import math

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

print(b//x - math.ceil(a/x) + 1)

Submission status: Wrong Answer

Solution code:
import sys

a, b, c = list(map(int, input().split()))
if a==b and a%c:
    print(0)
    sys.exit()
print(int(b/c-a/c+1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s=(a//x)*x
ans=0

while s<=b:
    s+=x
    ans+=1
print(ans)

Submission status: Wrong Answer

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

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