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 = input().split(" ")
b = int(a[1])
x = int(a[2])
a = int(a[0])
print(int((b - a + 1) // x))

Submission status: Wrong Answer

Solution code:
def input_int():
    return(int(input()))

def input_int_list():
    return(list(map(int,input().split())))

def input_int_map():
    return(map(int,input().split()))


def run():
    a, b, x = input_int_map()
    result = count_num(b, x) - count_num(a - 1, x)
    print(result)

def count_num(num, x):

    if num < 0:
        return 0

    return num // x

run()

# 2 4 3

# 3 4 3

# 2 6 3

Submission status: Wrong Answer

Solution code:
def input_int():
    return(int(input()))

def input_int_list():
    return(list(map(int,input().split())))

def input_int_map():
    return(map(int,input().split()))

import math
def run():

    a, b, x = input_int_map()

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

    if start > b:
        print(0)
        return

    result = 1 + (b - start) // x

    print(result)


run()

# 2 4 3

# 3 4 3

# 2 6 3

Submission status: Wrong Answer

Solution code:
def input_int():
    return(int(input()))

def input_int_list():
    return(list(map(int,input().split())))

def input_int_map():
    return(map(int,input().split()))

import math
def run():

    a, b, x = input_int_map()

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

    if start > b:
        print(0)
        return

    result = (b - start) // x

    print(result)


run()

# 2 4 3

# 3 4 3

# 2 6 3

Submission status: Wrong Answer

Solution code:
def input_int():
    return(int(input()))

def input_int_list():
    return(list(map(int,input().split())))

def input_int_map():
    return(map(int,input().split()))

import math
def run():

    a, b, x = input_int_map()


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

    if start > b:
        print(0)
        return

    result = 1 + (b - start) // x

    print(result)


run()

# 2 4 3

# 3 4 3

# 2 6 3

Submission status: Wrong Answer

Solution code:
def input_int():
    return(int(input()))

def input_int_list():
    return(list(map(int,input().split())))

def input_int_map():
    return(map(int,input().split()))

def run():

    a, b, x = input_int_map()

    diff = (b - a) // x

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

    if diff == 0:

        if x > a and x < b:
            print(1)
            return

    print(diff)


run()

# 2 4 3

Submission status: Wrong Answer

Solution code:
def input_int():
    return(int(input()))

def input_int_list():
    return(list(map(int,input().split())))

def input_int_map():
    return(map(int,input().split()))

def run():

    a, b, x = input_int_map()

    diff = (b - a) // x

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

    print(diff)


run()

Submission status: Wrong Answer

Solution code:
def input_int():
    return(int(input()))

def input_int_list():
    return(list(map(int,input().split())))

def input_int_map():
    return(map(int,input().split()))

def run():

    a, b, x = input_int_map()

    start = a // x
    end = b // x
    diff = end - start

    if diff == 0:
        print(0)
        return

    print(diff + 1)

run()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

cnt = 0
y = x

if x == 1:
  cnt = b - (a - 1)
  
else:
  while True:
    if a <= y <= b:
      cnt += 1
    if b < y:
      break
    y += x
    
print(cnt)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print((b - a) // x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def divided_num(n):
    return n//x + 1

if a==b:
    print(0)
else:
    print(divided_num(b)-divided_num(a)+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)

Submission status: Wrong Answer

Solution code:
import re
import copy

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

a,b,x = accept_input()

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

Submission status: Wrong Answer

Solution code:
import re
import copy

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

a,b,x = accept_input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
(a,b,x)=map(float, 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(math.floor(b/x)-math.ceil(a/x)+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

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

    num = a
    num += num % x

    num2 = b
    num2 -= num2 % x

    ans = (num2 - num) // x
    if (num2 - num) % 2 == x % 2:
        ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

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

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

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

    up = 0
    down = 0
    for i in range(10**18):
        num = b - i
        if num == a:
            break
        if num % x == 0:
            up = num // x
            break
    for i in range(10**18):
        numnum = a + i
        if numnum == b:
            break
        if numnum % x == 0:
            down = numnum // x
            break

    ans = up - down + 1
    if up == 0 and down == 0:
        ans = 0
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

#最小値
min_div = a + x - (a % x)

#最大値
max_div = b - (b % x)

print(int(max((max_div - min_div + x) // x, 0)))

Submission status: Wrong Answer

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

#最小値
min_div = a + (a % x)

#最大値
max_div = b - (b % x)

print(int(max((max_div - min_div + x) // x, 0)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(0)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7


a, b, x = rm()
a = math.floor(a//x * x)
b = math.floor(b//x * x)
print(b//x - a//x + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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:
    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 or b % x == 0:
    ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(a//x+b//x + (a % x == 0))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# cook your dish here

li=list(map(int,input().split()))
if li[0]==li[1]:
    k=int(li[0]//li[2])
    if k*li[2]==li[0]:
        print(1)
    else:
        print(0)
elif li[0]<li[2]:
    if li[0]==0:
        print(li[1]//li[2]+1)
    else:
        print(li[1]//li[2])
else:
    print((li[1]//li[2])-(li[0]//li[2])+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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:
import math
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

a,b,x = LI()

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

print(ans)

Submission status: Wrong Answer

Solution code:
import math
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

a,b,x = LI()

if a > 0:
    a -= 1
ans = b//x - a//x

print(ans)

Submission status: Wrong Answer

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

A=a//x

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(0 if B-A==0  else B-A+1)

Submission status: Wrong Answer

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

print(0 if B-A==0  else B-A+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def delete_head_zeros(n):
	n = str(n)
	l = len(n)
	if "." in n:
		l = n.find(".")
	head_zeros = 0
	for i in range(l - 1):
		if n[i] == "0":
			head_zeros += 1
		else:
			break

	return n[head_zeros:]

# compare a, b
# a, b: int or string
def bigint_compare(a, b):
	a = delete_head_zeros(a)
	b = delete_head_zeros(b)
	if len(a) > len(b):
		return 1
	elif len(a) < len(b):
		return -1
	else:
		if a > b:
			return 1
		elif a < b:
			return -1
		else:
			return 0

# calculate a + b
# a, b: int or string
def bigint_plus(a, b):
	a = str(a)
	b = str(b)

	d = max([len(a), len(b)])
	a = '0' * (d - len(a)) + a
	b = '0' * (d - len(b)) + b

	ans = ""
	carry = 0
	for i in range(d):
		s = int(a[-i-1]) + int(b[-i-1]) + carry
		carry = s // 10
		ans = str(s % 10) + ans
	else:
		if carry:
			ans = str(carry) + ans

	return ans

# calculate a - b
# a, b: int or string
def bigint_minus(a, b): 
	a = str(a)
	b = str(b)
	M = []
	m = []
	sign = ""

	if len(a) > len(b) or (len(a) == len(b) and a >= b):
		[M, m] = [a, b]
	else:
		[M, m] = [b, a]
		sign = "-"
	m = '0' * (len(M) - len(m)) + m

	ans = ""
	borrow = 0
	for i in range(len(M)):
		s = int(M[-i-1]) - int(m[-i-1]) - borrow
		if s < 0:
			borrow = 1
			s += 10
		else:
			borrow = 0
		ans = str(s) + ans

	return sign + delete_head_zeros(ans)

# calculate a * b
# a, b: int or string
def bigint_multiply(a, b):
	a = str(a)
	b = str(b)

	md = []
	carry = 0
	for j in range(len(b)):
		mj = ""
		for i in range(len(a)):
			m = int(a[-i-1]) * int(b[-j-1]) + carry
			carry = m // 10
			mj = str(m % 10) + mj
		else:
			if carry:
				mj = str(carry) + mj
		md.append(mj)

	ans = 0
	for k in range(len(md)):
		ans = bigint_plus(md[k] + "0" * k, ans)

	return ans


# calculate a / b to d digits after decimal point
# a, b, d: int or string
def bigint_divide(a, b, d = 0):
	a = str(a)
	b = str(b)
	d = int(d)
	if d < 0:
		d = 0

	ans = ""
	r = ""
	for i in range(len(a) + d):
		q = 0
		if i < len(a):
			r += a[i]
		elif i == len(a):
			ans += "."
			r += "0"
		else:
			r += "0"

		if bigint_compare(r, b) == -1:
			ans += str(q)
		else:
			while bigint_compare(r, b) >= 0:
				r = bigint_minus(r, b)
				q += 1
			ans += str(q)

	return delete_head_zeros(ans)

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:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop
# import numpy as np

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    a, b, x = MAP()
    if b - a < x:
        print(0)
        sys.exit()

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop
# import numpy as np

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    a, b, x = MAP()
    if b - a < x:
        print(0)
        sys.exit()

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if __name__ == "__main__":
  resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math


a, b, z = [int(w) for w in input().split()]

l = math.ceil(a/z)
r = b//z

print(r-l+1)

Submission status: Wrong Answer

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

    print(ans)

resolve()

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

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

print(d)

Submission status: Wrong Answer

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

c = b - a

d = c // x

print(d)

Submission status: Wrong Answer

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


if (a/x).is_integer() and b >= x:
    print(b//x-a//x+1)
else:
    print(b//x-a//x)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if (a/x).is_integer() and (b/x).is_integer():
    print(b//x-a//x+1)
else:
    print(b//x-a//x)

Submission status: Wrong Answer

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

if (a/x).is_integer():
    print(b//x-a//x+1)
else:
    print(b//x-a//x)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
#a<=y<=bでy%x=0を満たすyの個数を求める
def between(a,b,x):
    if b<x and b!=0:
        print(0)
        return
    elif b<x and b==0:
        print(1)
        return
    elif a<=x:
        num=x
    elif x<a:
        num=a
        while num%x!=0:
            num+=1
    print((b-num)//x+1)

between(a,b,x)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
#a<=y<=bでy%x=0を満たすyの個数を求める
def between(a,b,x):
    if b<x:
        print(0)
        return
    num=a
    while num%x!=0:
        num+=1
    
    print((b-num)//x+1)

between(a,b,x)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

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

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
#a<=y<=bでy%x=0を満たすyの個数を求める
def between(a,b,x):
    if b<x:
        print(0)
        return
    elif x==1:
        print(b-a+1)
        return
    elif a==b and a!=x:
        print(0)
        return
    else:
        if a<=x:
            print((b-x)//x+1)
            return
        else:
            print((b-a)//x+1)
between(a,b,x)

Submission status: Wrong Answer

Solution code:
import math
import sys
import numpy as np
from decimal import *
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 (b == 0):
    ans = 0
elif (a == 0) and (b != 0):
    ans = Decimal(b // x)

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


print(int(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, readline().split())
'''
num = b - a + 1
arr = np.linspace(a, b, num)
div = np.where(arr % x == 0)
ans = div[0][0]
'''
if (b == 0):
    ans = 0
elif (a == 0) and (b != 0):
    ans = b // x

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


print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
#a<=y<=bでy%x=0を満たすyの個数を求める
def between(a,b,x):
    if b<x:
        print(0)
        return
    elif x==1:
        print(b-a+1)
        return
    else:
        if a<=x:
            print((b-x)//x+1)
            return
        else:
            print((b-a)//x+1)
between(a,b,x)

Submission status: Wrong Answer

Solution code:
import decimal
decimal.getcontext().prec=50
a,b,x=map(int,input().split())
a=decimal.Decimal(a)
b=decimal.Decimal(b)
print(int(b/x)-int((a+x-1)/x))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from decimal import *
a, b, x = map(int, input().split())
ax = int(Decimal(a) / Decimal(x))
bx = int(Decimal(b) / Decimal(x))
am = a % x
bm = b % x
if ax == bx and am != 0 and bm != 0:
  print(0)
else:
  if bx == 0:
    print(bx - ax)
  else:
    print(bx - ax + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count=0
if a<=x :
    ai = x
else:
    ai = (a//x)*x
    if ai<a :
        ai +=x
if ai<=b :
    count+=1
    count+=(b-ai)//x

print(count)

Submission status: Wrong Answer

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

count=0
if a<x :
    ai = x
else:
    ai = (a//x+1)*x
if ai<=b :
    count+=1
    count+=(b-ai+1)//x

print(count)