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())

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

ans = max(0,(b/x)+1  -(a/x))

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def func(n):
    if n == 0:
        return 0
    else:
        return n / x + 1


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 0
    else:
        return int(n / x) + 1


print(func(b) - func(a - 1))

Submission status: Wrong Answer

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

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)
elif 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:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

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

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

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

Submission status: Wrong Answer

Solution code:
#coding: utf-8

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

upper = b // x
lower = a // x

if(lower % x == 0):
    lower -= 1

ans = int(upper - lower)

print(ans)

Submission status: Wrong Answer

Solution code:
#coding: utf-8

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

upper = b // x
lower = a // x

if(lower % x == 0):
    a -= 1

ans = int(upper - lower)

print(ans)

Submission status: Wrong Answer

Solution code:
#coding: utf-8

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

upper = b // x
lower = a // x

if(lower % x == 0):
    a += 1

ans = int(upper - lower)

print(ans)

Submission status: Wrong Answer

Solution code:
#coding: utf-8

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

upper = b // x
lower = a // x

ans = int(upper - lower)

print(ans)

Submission status: Wrong Answer

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

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(d-c)

Submission status: Wrong Answer

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

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

print(d-c)

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:
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==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())

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

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,c = map(int,input().split())
print(b//c-a//c+min(1,a//c))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

m=a//x
n=b//x
k=b%x

if k==0:
  print(m-n+1)
else:
  print(m-n)

Submission status: Wrong Answer

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

m=a//x
n=b//x

if n==0:
  print(m-n+1)
else:
  print(m-n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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:
a,b,x = map(int,input().split())
ans = (b+1)//x - a//x

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

if a==b:
    print(0)

else:
    if a != 0:
        a -= 1

    b+=1

    print((b-a)//c)
# print(((b-a)//c) if (b-a)//c%2==0 else (b-a)//c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

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

Submission status: Wrong Answer

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

for j in range(b+1):
    if (j%x==0):
        ansB+=1

print(ansB-ansA)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
v = input().split(" ")

a = int(v[0])
b = int(v[1])
x = int(v[2])

fb = b/x
fa = (a-1)/x

print(max(fb-fa, 0))

Submission status: Wrong Answer

Solution code:
v = input().split(" ")

a = int(v[0])
b = int(v[1])
x = int(v[2])

fb = b/x
fa = (a-1)/x

print(fb-fa)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c = (int(_) for _ in input().split())  
print(b//c-a//c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from decimal import Decimal

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

count = 0
for i in range(b, a-1, -1):
    if i%x==0:
        i_deci = Decimal(str(i))
        x_deci = Decimal(str(x))
        count = int(i_deci/x_deci)
        break


if count == 0:
    pass
else:        
    count = count - int((a-1)/x)


print(count)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a_tmp = x * math.ceil(a / x)

diff = b - a_tmp
res = diff // x

if a_tmp > b:
    print(0)
    exit()
else:
    res += 1


print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    input = sys.stdin.readline
    try:
        a, b, x = map(int, input().split())
        ans = (b/x+1) - ((a/x+1) - (1 if a%x==0 else 0))
        import math
        print(math.floor(ans))

    finally:
        input = None

import sys; sys.setrecursionlimit(50000)
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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(((abs(A-B)) // X + 1))
else:
    print((abs(A-B)) // X)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

A,B,X = map(int, input().split())

if(A%X == 0):
    print(((abs(A-B)) // X + 1))
else:
    print((abs(A-B)) // X)

Submission status: Wrong Answer

Solution code:
#48
import math
a, b, x = map(int, input().split())
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:
 
a,b,x=map(int,input().split())
 
print(b//x-(a-2)//x)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a_tmp = x * math.ceil(a / x)

diff = b - a_tmp
print(max(diff // x + 1,0))

Submission status: Wrong Answer

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

a_tmp = x * math.ceil(a / x)

diff = b - a_tmp
print(diff // x + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

check_a = x * math.ceil(a / x)
check_b = b // x * x
# print(check_a, check_b)

if check_a == 0 & check_b == 0:
    print(0)
else:
    print(((check_b - 1) - (check_a )) // x + 2)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
import math
check_a = x * math.ceil(a / x)
check_b = b // x * x
# print(check_a, check_b)
if check_a == check_b:
    print(0)
else:
    print(((check_b - 1) - (check_a )) // x + 2)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
import math
check_a = x * math.ceil(a / x)
check_b = b // x * x

print(((check_b - 1) - (check_a )) // x + 2)

Submission status: Wrong Answer

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

all_count = 0
dev = 0
if b > 0:
    all_count = b // x

if a > 0:
    dev = (a-1) // x
print(all_count - dev)

Submission status: Wrong Answer

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

all_count = b // x
dev = 0

if(a > 0):
    dev = (a-1) // x
print(all_count - dev)

Submission status: Wrong Answer

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

all_count = b // x
dev = a // x

print(all_count - dev)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

a, b, x = MAP()

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

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

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

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

a, b, x = MAP()
count = (b-a)//x
if a%x == 0 or b%x == 0:
	count += 1
print(count)

Submission status: Wrong Answer

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

cnt = 0

start = a // x
end = b// x

print(end - start)

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 math
a,b,c=map(int,input().split())
print(math.floor(b/c) - math.floor((a-1)/c) if a !=0 else math.floor(b/c)+1)

Submission status: Wrong Answer

Solution code:
import math
a,b,c=map(int,input().split())
print(math.floor((b-a)/c) if a !=0 else math.floor((b-a)/c)+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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:

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = (b - a) // 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) // x
if a % 2 == 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:
n = list(map(int,input().split()))
if n[0] == 0:
        print(n[1]//n[2]+1)
else:
        print(n[1]//n[2]-n[0]//n[2])

Submission status: Wrong Answer

Solution code:
k = list(map(int,input().split()))
if k[1]%k[2] ==0:
    print((k[1]-k[0])//k[2]+1)
else:
    print(k[1]//k[2]-k[0]//k[2])

Submission status: Wrong Answer

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

print(k[1]//k[2]-k[0]//k[2])

Submission status: Wrong Answer

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

print(k[0]//k[2]-k[1]//k[2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

def main():
    a, b, x = map(int,input().split())
    re_b = (b//x)+1
    re_a = ((a-1)//x)+1
    if a-1 != 0:
        print(re_b - re_a)
    else:
        print(re_b)
main()

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:

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

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

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABC 046 B

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

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

Submission status: Wrong Answer

Solution code:
def f(n, x):
    return n//x + 1

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

Submission status: Wrong Answer

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

a_mod = a%x
b_mod = b%x
diff = b - a
ans = (diff // x)

if a_mod >= b_mod:
    ans += 1
print(ans)

Submission status: Wrong Answer

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

a_mod = a%x
b_mod = b%x
diff = b - a
ans = (diff // x)

if (a_mod == 0) and (b_mod == 0):
    ans += 1
elif a_mod > b_mod:
    ans += 1
print(ans)

Submission status: Wrong Answer

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

a_mod = a%x
b_mod = b%x
diff = b - a
ans = (diff // x)

if (a_mod == 0) and (b_mod == 0):
    ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(t2-t1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y,z=map(int,input().split())
t1=0
t2=0
for i in range(1,x):
  if i%z==0:
    t1+=1
for i in range(1,y):
  if i%z==0:
    t2+=1
if x%z==0:    
  print(t2-t1+1)
else:
  print(t2-t1)

Submission status: Wrong Answer

Solution code:
x,y,z=map(int,input().split())
t1=0
t2=0
for i in range(1,x):
  if i%z==0:
    t1+=1
for i in range(1,y):
  if i%z==0:
    t2+=1
    
print(t2-t1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,x = map(int, input().split())
c = int((a-1)/x)
d = int(b/x)
if a!=0:
  print(d-c)
elif a==0:
  print(d)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int, input().split())
c = (a-1)//x
d = b//x
if a!=0:
  print(d-c)
elif a==0:
  print(d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

a, b, x = list(map(int, input().split()))
top = int(b/x)
bottom = math.ceil(a/x)
print(top-bottom+1)

Submission status: Wrong Answer

Solution code:
from statistics import mean, median,variance,stdev
import sys
import math
import fractions
def j(a):
    if a==1: print("YES")
    else :print("NO")


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

#x = int(input())                              #入力整数1つ
#x,y = (int(i) for i in input().split())      #入力整数横2つ
x,y,z = (int(i) for i in input().split())    #入力整数横3つ
#a,b,c,k = (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
#x = input()                                  #入力文字列
#a = input().split()                          #入力文字配列

print((y-x+1)//z)

Submission status: Wrong Answer

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

ans = b // x - a // x
if a % x == 0 and b % x ==0:
  ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
N=[]
c=0
for i in range (a,b+1):
  N.append(i)
for y in N:
  if y%x==0:
    c=+1
  else:
    pass
print(c)

Submission status: Wrong Answer

Solution code:
""" AtCoder """

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

def f(n):
    if n > 0:
        return n//x
    else:
        return 0

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

Submission status: Wrong Answer

Solution code:
""" AtCoder """

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

ans = (b - a)//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=map(int,input().split())
c=0
for i in range(a,b+1):
  if i%x==0:
    c+=1
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
a, b, x = map(int, input().split())


def solve1():
    xa = (a-1)//x
    xb = b//x
    return xb-xa+1


print(solve1())

Submission status: Wrong Answer

Solution code:
from math import ceil
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
a, b, x = map(int, input().split())


def solve1():
    xa = ceil((a-1)/x)
    xb = b//x
    return xb-xa+1


print(solve1())

Submission status: Wrong Answer

Solution code:
from math import ceil
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
a, b, x = map(int, input().split())


def solve1():
    xa = ceil(a/x)
    xb = b//x
    return xb-xa+1


print(solve1())

Submission status: Wrong Answer

Solution code:
from math import ceil
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
a, b, x = map(int, input().split())


def solve1():
    xa = ceil(a/x)
    xb = b//x
    return xb-xa+1


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


def solve2():
    return f(b)-(a-1)-1


print(solve2())