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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
if a==0:
    #0以上b以下でbで割り切れる個数
    if b%x==0:
        ans_b = b//x +1
    else:
        ans_b = b//x
    #0以上a未満でbで割り切れる個数
    if a%x==0:
        ans_a = a//x
    else:
        ans_a = a//x + 1
else:
    ans_b = b//x
    if a%x==0:
        ans_a = a//x -1
    else:
        ans_a = a//x

print(ans_b-ans_a)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
#まず0~bでxで割り切れる個数
if b%x==0:
    ans_b = b//x +1
else:
    ans_b = b//x
#0以上a未満でxで割り切れる個数
ans_a=a//x

print(ans_b-ans_a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
M = b % c
m = a % c
res = (b-M)/c+(m-a)/c
K=int(res)+1
print(K)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
mini = 0
maxi = 0
M = b % c
m = a % c
res = (b-M)/c+(m-a)/c
int(res)
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans=0
if a!=b:
    A = (a-1)//x
    B = b//x

    ans = B - A
elif a==0 and b==0:
    ans=1

print(ans)

Submission status: Wrong Answer

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

ans=0
if a!=b:
    A=(a-1)//x
    B=b//x

    ans=B-A

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    a, b, x = map(int, input().split())

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

    print(r)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    a, b, x = map(int, input().split())

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

    print(r)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print(b // x - max(0, a - 1) // x + 1 if a == 0 else 0) # aが0のときどうすりゃいいのか直感ではまったくわからんのだが

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == "__main__":
    main()

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

# a = p * x + r, b = q * x + s と剰余を使って表す
p = a // x
q = b // x

res = p - q
print(res)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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


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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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


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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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


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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

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

Submission status: Wrong Answer

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

n = b - a

add = 0
if a % x == 0:
    add += 1
if b % x == 0:
    add +=1
print(n // x + add)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

n = b - a

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

res = 0
d_min = a // x
d = (b-a) // x
res = d + ( 1 if d_min * x >= a else 0)

print(res)

Submission status: Wrong Answer

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

A = 0
B = 0
for i in range(x):
    if (a+i) % x == 0:
        A = (a+i)//x
        break
for i in range(x):
    if (b+i) % x == 0:
        B = (b+i)//x
        break
if A == B:
    print(0)
else:
    print(B-A+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:
import math
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# ----------------------------------------
a, b, x = map(int, readline().split())
'''
num = b - a + 1
arr = np.linspace(a, b, num)
div = np.where(arr % x == 0)
ans = div[0][0]
'''
if (a == 0):
    ans = b // x - a // x + 1
else:
    ans = b // x - a // x


print(ans)

Submission status: Wrong Answer

Solution code:
import math
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# ----------------------------------------
a, b, x = map(int, read().split())
'''
num = b - a + 1
arr = np.linspace(a, b, num)
div = np.where(arr % x == 0)
ans = div[0][0]
'''
if (a == 0):
    ans = b // x - a // x + 1
else:
    ans = b // x - a // x


print(ans)

Submission status: Wrong Answer

Solution code:
import math
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# ----------------------------------------
a, b, x = map(int, read().split())
'''
num = b - a + 1
arr = np.linspace(a, b, num)
div = np.where(arr % x == 0)
ans = div[0][0]
'''
if (b < x):
    ans = 0
else:
    if (a == 0):
        ans = b // x - a // x + 1
    else:
        ans = b // x - a // x


print(ans)

Submission status: Wrong Answer

Solution code:
import math
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# ----------------------------------------
a, b, x = map(int, read().split())
'''
num = b - a + 1
arr = np.linspace(a, b, num)
div = np.where(arr % x == 0)
ans = div[0][0]
'''
if (b < x):
    ans = 0
else:
    bx = b // x
    ax = (a - 1) // x
    ans = bx - ax


print(ans)

Submission status: Wrong Answer

Solution code:
import math
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# ----------------------------------------
a, b, x = map(int, read().split())
'''
num = b - a + 1
arr = np.linspace(a, b, num)
div = np.where(arr % x == 0)
ans = div[0][0]
'''
if (b < x):
    ans = 0
else:
    bx = b // x
    if (a == 0):
        ans = bx
    else:
        ax = a // x
        ans = bx - ax
        if (a % x == 0):
            ans += 1


print(ans)

Submission status: Wrong Answer

Solution code:
import math
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# ----------------------------------------
a, b, x = map(int, read().split())
'''
num = b - a + 1
arr = np.linspace(a, b, num)
div = np.where(arr % x == 0)
ans = div[0][0]
'''
if (b < x):
    ans = 0
else:
    bx = b // x
    ax = a // x
    ans = bx - ax
    if (a % x == 0):
        ans += 1


print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil
from math import floor
l = list(map(int,input().split()))
a = l[0]
b = l[1]
x = l[2]
if a == b:
	print(0)
else:
	if x%2 == 0:
		print(ceil((b-a+1)/x))
	else:
		print(floor((b-a+1)/x))

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

Submission status: Wrong Answer

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

c = b - a

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

Submission status: Wrong Answer

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

c = b - a

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

c = b - a

print(m + c // x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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())
t = 0
if a % x == 0:
    t += 1

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print((b-s)//x+t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))


a, b, x = LI()
acnt = (a - 1) // x if a != 0 else 0
bcnt = b // x if b != 0 else 1
ans = bcnt - acnt
print(ans)

Submission status: Wrong Answer

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))


a, b, x = LI()
acnt = (a - 1) // x if a != 0 else 0
bcnt = b // x
ans = bcnt - acnt
print(ans)

Submission status: Wrong Answer

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))


a, b, x = LI()
acnt = (a - 1) // x if a > 0 else 0
bcnt = b // x if b > 0 else 0
ans = bcnt - acnt
print(ans)

Submission status: Wrong Answer

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))


a, b, x = LI()
acnt = (a - 1) // x if a > 0 else 0
bcnt = b // x
ans = bcnt - acnt
print(ans)

Submission status: Wrong Answer

Solution code:
from decimal import * 
a, b, x = map(str, input().split())
a = Decimal(a)
b = Decimal(b)
x = Decimal(x)

ans = (b - a) / x

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

print(int(ans))

Submission status: Wrong Answer

Solution code:
from decimal import * 
a, b, x = map(str, input().split())
a = Decimal(a)
b = Decimal(b)
x = Decimal(x)

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())
count = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(a,b):
    if(i % x == 0):
        count += 1
if(a == b):
    print(0)
elif(b == 10**18):
    print(str(x) * 17)
else:
    print(count + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from decimal import *
import math
#exp = Decimal(10**23)
#rint((Decimal(11)*exp)/Decimal(10))

## coding: UTF-8
s = input().split()
t = [int(p) for p in s]
#print(t)

a = t[0]
b = t[1]
x = t[2]

n = math.floor(Decimal(b-a+1) / Decimal(x))

p = (b-a+1) % x
if(p > 0):
    l = a % x
    if(l <= p-1):
        n += 1
print(n)

'''
start = a
goal = b
while True:
    if(start % x == 0):
        break
    else:
        start += 1
#print(start)
while True:
    if(goal % x == 0):
        break
    else:
        goal -= 1
#start = Decimal(3)
#goal = Decimal(999999999999999999)

#print(Decimal(goal))
print(Decimal(Decimal(Decimal(goal) - Decimal(start)) / Decimal(x)) + Decimal(1)  ) 
#answer = ((goal - start) / x ) + 1
#print('{}'.format(int(answer)))
'''
'''
#AC code
def count_even(t, x):
    return int( Decimal(t)/ Decimal(x) )

if( a == 0):
    answer = count_even(b, x) + 1
else:
    answer = count_even(b, x) - count_even(a-1, x)
print(answer)
'''

Submission status: Wrong Answer

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

aa = (a-1) // 3 + 1

bb = b // 3

print(bb - aa + 1)

Submission status: Wrong Answer

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

aa = a + a % x

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

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
import math
import sys
def sinput(): return sys.stdin.readline()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(): return list(imap())
def farr(): return list(fmap())
def sarr(): return sinput().split()

a, b, x = imap()
ans = math.floor(b/x) - math.floor(a/x)
if a % x == 0: ans += 1
print(ans)

Submission status: Wrong Answer

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

while a <= num <= b and num % x == 0:
    cnt += 1
    num += x
print(cnt)

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)
else:
    print(b//x-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:
a,b,x = map(int,input().split())
ans = 0
bb = b/2

if bb%2 != 0:
  bb = int(bb + 0.5)
  
bb = int(bb)
for i in range(a,bb):
  if i % x == 0:
    ans += 1
    
for i in range(bb,b+1):
  if i % x == 0:
    ans += 1
    
print(ans)

Submission status: Wrong Answer

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

print(solve())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:

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


def func(num1, num2, divide_num):
    ans = (num2 - num1) // divide_num
    if num1 % divide_num == 0:
        ans += 1

    print(ans)


func(num1=a, num2=b, divide_num=x)

Submission status: Wrong Answer

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

if a%x==0:
  a-=x
elif b%x==0:
  b+=x
count=(b-a)//x
if count<0:
  count=0
print(count)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
import math
ta=math.ceil(a/x)
if abs(a-ta*x)>x:
  ta=ta+1
tb=b//x
ans=tb-ta+1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
a, b, c = map(Decimal, input().split())
print(a//c - b//c if a%c != 0 else a//c - b//c +1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat May 30 16:32:18 2020

@author: NEC-PCuser
"""

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

a_shou = a / x
b_shou = b / x

ans = b_shou - a_shou

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

print(int(ans))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat May 30 16:32:18 2020

@author: NEC-PCuser
"""

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

a_shou = a / x
b_shou = b / x

ans = b_shou - a_shou

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

print(int(ans))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat May 30 16:32:18 2020

@author: NEC-PCuser
"""

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

a_amari = a % x
b_amari = b % x

ans = (b - a) / x

if ((a_amari + b_amari) % x == 0):
    ans += 1

print(int(ans))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat May 30 16:32:18 2020

@author: NEC-PCuser
"""

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

a_amari = a % x
b_amari = b % x

ans = (b - a) / x

if ((a_amari + b_amari % x) == 0):
    ans += 1

print(int(ans))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat May 30 16:32:18 2020

@author: NEC-PCuser
"""

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

a_amari = a % x
b_amari = b % x

ans = (b - a) / x

if (a_amari == 0 and b_amari == 0):
    ans += 1

print(int(ans))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat May 30 12:02:39 2020

@author: naoki
"""

a,b,x = map(int,input().split()) # 整数a,b及び割る数xを入力
if a%x == 0 or b%x == 0:
    print(b//x - a//x + 1)
else:
    print((b-b%x)//x - (a-a%x)//x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

i = a// x
j = b// x
p = i
q = j
while i* x < a:
  i+= 1
  p = i* x
while j* x < b:
  j+= 1
  q = (j- 1)* x

ans = int((q- p)// x)+ 1

if(ans<= 0):
  print(0)
else:
  print(ans)

Submission status: Wrong Answer

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

i = a
j = b
while i % x != 0:
  i+= 1

while j % x != 0:
  j-= 1
  
ans = (j- i)/ x+ 1

if(ans<= 0):
  print(0)
else:
  print(int(ans))

Submission status: Wrong Answer

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

ans = (b- a)// x

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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


print(ans)

Submission status: Wrong Answer

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

count = b//x - a//x

if a%x == 0 and a != 0:
    count += 1

print(count)

Submission status: Wrong Answer

Solution code:
import sys


numbers = sys.stdin.readline().split(' ')

a = int(numbers[0])
b = int(numbers[1])
c = int(numbers[2])


if a > 0:
    print(b//c - (a-1)//c)
else:
    print(b//c)

Submission status: Wrong Answer

Solution code:
import sys


numbers = sys.stdin.readline().split(' ')

a = int(numbers[0])
b = int(numbers[1])
c = int(numbers[2])


if a > 0:
    print(int(b//c - (a-1)//c))
else:
    print(int(b//c))

Submission status: Wrong Answer

Solution code:
import sys
import math

numbers = sys.stdin.readline().split(' ')

a = int(numbers[0])
b = int(numbers[1])
c = int(numbers[2])


if a > 0:
    print(int(b//c - (a-1)//c))
else:
    print(math.floor(b//c))

Submission status: Wrong Answer

Solution code:
import sys

numbers = sys.stdin.readline().split(' ')

a = int(numbers[0])
b = int(numbers[1])
c = int(numbers[2])


if a > 0:
    print(b/c - (a-1)/c)
else:
    print(b/c)

Submission status: Wrong Answer

Solution code:
import sys

numbers = sys.stdin.readline().split(' ')

a = int(numbers[0])
b = int(numbers[1])
c = int(numbers[2])

if a > 0:
    print(int(b/c) - int((a-1)/c))
else:
    print(int(b/c))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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