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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
  num = list(map(int,input().split()))
  count=0
  print(num[1])
  for i in range(num[0],num[1]+1):
    if i%num[2]==0 :
      count+=1
  print(count)
  
main()

Submission status: Wrong Answer

Solution code:
import collections
 
#文字列を一文字ずつ取得したいとき
def inputStrOnebyOne():
    s = list(input())
    return s
 
#整数を一つずつリストに入れる
def inputOnebyOne_Int():
    a = list(int(x) for x in input().split())
    return a
 
def main():
    a, b, x = map(int, input().split())
    ret = 0
    if b-a != 0:
        ret = int(b//x-((a-1)//x))
    print(ret)
 
if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

print(b//x-a//x+int(b%x == 0 and a%x == 0))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
 
if a == 0 and b % x == 0 and x != 1:
    print((b-a)//x)
elif 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 == 0 and b % x == 0:
    print((b-a)//x)
elif 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 == 0 and b==0:
    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 numpy as np
a, b, x = map(int, input().split())

if  (a!= 0 and a % x == 0) or (b!= 0 and 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!= 0 and a % x == 0) or (b!= 0 and b % x == 0) ==0:
    print((b-a)//x + 1)
else:
    print((b-a)//x)

Submission status: Wrong Answer

Solution code:
import numpy as np
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(" "))
a = 0 if a - 1 < 0 else a - 1
ans = b//x - a//x

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 0
temp_A = 0
temp_B = 0
for i in range(B, 0, -1):
    if i % X == 0:
        temp_B = i
        break

for i in range(A-1, 0, -1):
    if i % X == 0:
        temp_A = i
        break

if temp_A != 0:
    ans_a = temp_A / X
else:
    ans_a = 0

if temp_B != 0:
    ans_b = temp_B / X
else:
    ans_b = 0

ans = ans_b - ans_a

if X == 1:
    ans = B+1

print('{:.18g}'.format(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())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    a,b,x=map(int, readline().rstrip().split())
    if a%x==0:
        f=a
    else:
        f=a+a%x
    if b%x==0:
        t=b
    else:
        t=b+b%x-x

    print((t-f)//x+1)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(tmp)

Submission status: Wrong Answer

Solution code:
def cin():
	return map(int,input().split())

def cino(test=False):
    if not test:
        return int(input())
    else:
        return input()
def cina():
  return list(map(int,input().split()))

def ssplit():
    return list(input().split())
import math
a,b,c = cin()
print(b//c - math.ceil(a/c)+1)

Submission status: Wrong Answer

Solution code:
def cin():
	return map(int,input().split())

def cino(test=False):
    if not test:
        return int(input())
    else:
        return input()
def cina():
  return list(map(int,input().split()))

def ssplit():
    return list(input().split())

a,b,c = cin()
print(b//c - a//c)

Submission status: Wrong Answer

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

ax = max(0,(a-1)//x)
bx = b//x

#print(ax)
#print(bx)

print(bx-ax)

Submission status: Wrong Answer

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

ax = max(0,(a-1)//x)
bx = b//x

#print(ax)
#print(bx)

print(bx-ax+1)

Submission status: Wrong Answer

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

ax = min(0,(a-1)//x)
bx = b//x

#print(ax)
#print(bx)#

print(bx-ax+1)

Submission status: Wrong Answer

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

ans=0
ans+=1*(A%X==0)
ans+=(B-A)//X

print(ans)

Submission status: Wrong Answer

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

multiples = (b - a) // x

if a % x == 0 or b % x == 0:
    multiples += 1

if a == b == 0:
    print(0)
else:
    print(multiples)

Submission status: Wrong Answer

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

multiples = (b - a) // x

if a % x == 0 or b % x == 0:
    multiples += 1

print(multiples)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc048/tasks/abc048_b

import math

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

max_num=math.floor(b/x)
min_num=math.ceil(a/x)

print(max_num-min_num+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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%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//x - a//x + 1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

a,b,x = map(int,input().split())
if b < x:
  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:
from sys import stdin


def ceil(a,b):
    return (a+b+1)//b


def floor(a,b):
    return a//b


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    a,b,x = list(map(int,_in[0].split(' ')))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    cnt = floor(b,x)-ceil(a,x)+1
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    a,b,x = list(map(int,_in[0].split(' ')))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    cnt = math.floor(b/x)-math.ceil(a/x)+1
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

print(a,b,x)

aw=a//x
bw=b//x
ans=bw-aw

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

print(ans)

Submission status: Wrong Answer

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

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

print(a,b)

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

a += (x - a%x)
b -= b%x

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

Submission status: Wrong Answer

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

a += (a - a%x)
b -= b%x

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

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
ans = 0
if a%x==0:
    c = a
    ans = 1
else:
    c = (a//x+1)*x
    ans = 0
    
while c<b:
    c += x
    ans += 1
    #print(c)
print(ans)

Submission status: Wrong Answer

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

a += (a - a%x)
b -= b%x

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
ans = 0
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())

xa = math.ceil(a / x)
xb = math.floor(b / x)
print(xb - xa + 1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

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

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

if n==0:
    if (b-a+1)%x>a%x:
        n+=1
elif (b-a+1)%x-(a//x*x-a)>0:
    n+=1

print(n)

Submission status: Wrong Answer

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

n=(b-a)//x

if (b-a)-n*x-a%x>=0:
    n+=1

print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
#  = int(input())
a, b, x  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
#  = int(input())
a, b, x  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

count = (b-a)//x

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

print(count)

Submission status: Wrong Answer

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

bb = b // x
aa = a // x

if a % 2 == 0:
  aa -= 1
  
if a == 0:
  print(bb+1)
else:  
  print(bb-aa)

Submission status: Wrong Answer

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

bb = b // x
aa = a // x

if a % 2 == 0:
  aa -= 1
  
print(bb-aa)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def sol(x,m):
	if x<=0:
		return 0
	else:
		return x//m

a,b,n = map(int,input().split())
if a==b:
	print(0)
else:
	if a==0:
		print(sol(b,n)+1)
	elif a==1:
		print(sol(b,n))
	else:
		print(sol(b,n)-sol(a-1,n))

Submission status: Wrong Answer

Solution code:
import math 
def sol(x,m):
	if x<=0:
		return 0
	else:
		return math.floor(x/m)

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

Submission status: Wrong Answer

Solution code:
def sol(x,m):
	if x<=0:
		return 0
	else:
		return x//m




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

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())
b_d = B//x+1
a_d = A//x
if A!=0:
   a_d+=1
print(b_d - a_d)

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:
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//x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x, y, z = map(int,input().split())

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

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
A = a//x
B = b//x
if a == 0:
  print(B-A+1)
elif 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_mod = b//x+1
b_mod = (a-1)//x+1 if a > 0 else 0
ans = b_mod - a_mod
print(ans)

Submission status: Wrong Answer

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

print(ans+1)

Submission status: Wrong Answer

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

print(ans+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

min_div = a // x
max_div = b // x

print(max_div - min_div + 1)

Submission status: Wrong Answer

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

fb=b//x+1

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

Submission status: Wrong Answer

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

import math

start=math.ceil(a/x)*x
end=(b//x)*x
#print(start,end)

ans=int((end-start)/x+1)

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def calc(n):
    if n <= -1 :
        cnt = 0
    else:
        cnt = int( n / x ) + 1
    return int(cnt)
    
cnt_a = calc(a-1)
cnt_b = calc(b)

ans = cnt_b - cnt_a
print(int(ans))

Submission status: Wrong Answer

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

ans = 0

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

if b % x == 0 or a % x == 0:
    ans += 1

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

Submission status: Wrong Answer

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

ans = 0

if b % x == 0 or a % x == 0:
    ans += 1

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

Submission status: Wrong Answer

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

m=(b-a)//x

if b%x==0 or a%x==0:
  print(int(m+1))
else:
  print(int(m))

Submission status: Wrong Answer

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

m=(b-a)//x

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

Submission status: Wrong Answer

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

m=(b-a)//x

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

Submission status: Wrong Answer

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

m=(b-a)//x

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

Submission status: Wrong Answer

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

q_b = b//x
q_a = a//x

if x==1:
    print(b-a+1)
else:
    print(int(q_b-q_a))

Submission status: Wrong Answer

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

q_b = b//x
q_a = a//x

if x==1:
    print(b-a+1)
elif a == b:
    print(0)
else:
    print(int(q_b-q_a))

Submission status: Wrong Answer

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

q_b = b/x
q_a = a/x

if x==1:
    print(b-a+1)
elif a == b:
    print(0)
else:
    print(int(q_b-q_a))

Submission status: Wrong Answer

Solution code:
import math  # noqa
import bisect  # noqa
import queue  # noqa


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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
ans=0
if (b-a+1)>=x:
    if a%x==0 and b%x==0:
        print(((b-a)//x)+1)
    elif not a%x==0 and not b%x==0:
        a=a+x-a%x
        b=b-b%x
        ans=(b//x)-(a//x)+1
    elif not a%x==0 and b%x==0:
        a=a+x-a%x
        ans=(b//x)-(a//x)+1
    elif a%x==0 and not b%x==0:
        b=b-b%x
        ans=(b//x)-(a//x)+1
else:
    c=b//x
    if a<=c*x:
        print(1)
    else:
        print(0)    

print(ans)

Submission status: Wrong Answer

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

a=a+x-a%x
b=b-b%x

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

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

if a+ans*(x+1)<=b:
    ans+=1

print(ans)

Submission status: Wrong Answer

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

if ans*(x+1)<=b:
    ans+=1

print(ans)

Submission status: Wrong Answer

Solution code:
def solve(a, b, x):
    a = max(a, x) if a != 0 else a
    if a % x != 0:
        a += a % x
    if b % x != 0:
        b -= b % x
    if a > b:
        print(0)
    else:
        print((b - a - 1) // x + 2)



T = list(map(int, input().split()))
solve(T[0], T[1], T[2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
a, b, x = map(int,input().split())
if a % x != 0:
    print(b//x - a//x + 2)
else:
    print(b//x - 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:
def count(n, x):
  if n == 0:
    return 0
  return n//x+1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt_a = a // x
cnt_b = b // x

print(cnt_b-cnt_a)

Submission status: Wrong Answer

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

start = math.ceil(a/x)
end = b//x

if start == 0 and end == 0:
    print(0)
else:
    print(end-start+1)

Submission status: Wrong Answer

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

start = math.ceil(a/x)
end = b//x

print(end-start+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(b%x+1)

Submission status: Wrong Answer

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

if a == b and a % x != 0:
  result = 0
  print(result)
  exit()
elif a == b and a % x == 0:
  result = 1
  print(result)
  exit()
else:
  B = divmod(b, x)
  A = divmod(a, x)
  result = B[0] - A[0]
  if a == 0 or (A[1] == 0 and B[1] == 0): result += 1
  print(result)