Problem:


Score : 100 points

Problem Statement

How many multiples of d are there among the integers between L and R (inclusive)?

Constraints

All values in input are integers.

1 \leq L \leq R \leq 100

1 \leq d \leq 100

Input

Input is given from Standard Input in the following format:

L R d

Output

Print the number of multiples of d among the integers between L and R (inclusive).

Sample Input 1

5 10 2

Sample Output 1

3

Among the integers between 5 and 10, there are three multiples of 2: 6, 8, and 10.

Sample Input 2

6 20 7

Sample Output 2

2

Among the integers between 6 and 20, there are two multiples of 7: 7 and 14.

Sample Input 3

1 100 1

Sample Output 3

100



Sample input:
5 10 2


Sample output:
3

Submission status: Runtime Error

Solution code:
def popcount(x): #xは10進数の整数
    return bin(x).count('1')
ma = 2*10**5
dp = [0] * ma
for i in range (1, ma):
    dp[i] = dp[i % popcount(i)] + 1
def solve(N, x):
    p = popcount(int(x, 2))
    nowp_p = int(x, 2) % (p+1)
    if p-1 != 0: 
        nowp_m = int(x, 2) % (p-1)
    x = list(x)#list
    for i in range(N):
        if x[i] == '0':
            print(dp[(nowp_p + 2**(N-i-1)) % (p + 1)] + 1)
        elif x[i] == '1':
            if p == 1:
                print(0)
            else:
                print(dp[(nowp_m - 2**(N-i-1) + p - 1) % (p - 1)] + 1)
N = int(input())
x = input() #str
solve(N, x)

Submission status: Runtime Error

Solution code:
n = int(input())
x = input()


def count(n):
    ans = 0
    while n:
        ans += n % 2
        n //= 2
    return ans


ma = 5*10**5
dp = [0] * ma
for i in range(1, ma):
    dp[i] = dp[i % count(i)]+1

c = x.count("1")
a = int(x, 2) % (c+1)

if c==1:
    for i in range(n):
        if x[i] == "0":
            print(dp[(a + pow(2, n-i-1, c+1)) % (c+1)] + 1)
        else:
            print(0)
    exit()

b = int(x, 2) % (c-1)
for i in range(n):
    if x[i] == "0":
        print(dp[(a + pow(2,n-i-1,c+1))%(c+1)] + 1)
    else:
        print(dp[(b - pow(2, n-i-1, c-1)) % (c-1)] + 1)

Submission status: Runtime Error

Solution code:
def popcount(x): #xは10進数の整数
    return bin(x).count('1')
def count(n):
    ans = 0
    while n != 0:
        ans += n % 2
        n //= 2
    return ans
ma = 2*10**5
dp = [0] * ma
for i in range (1, ma):
    dp[i] = dp[i % count(i)] + 1
def solve(N, x):
    p = popcount(int(x, 2))
    nowp_p = int(x, 2) % (p+1)
    if p-1 != 0: 
        nowp_m = int(x, 2) % (p-1)
    x = list(x)#list
    for i in range(N):
        if x[i] == '0':
            print(dp[(nowp_p + 2**(N-i-1)) % (p + 1)] + 1)
        elif x[i] == '1':
            if p == 1:
                print(0)
            else:
                print(dp[(nowp_m - 2**(N-i-1) + p - 1) % (p - 1)] + 1)
N = int(input())
x = input() #str
solve(N, x)

Submission status: Runtime Error

Solution code:
def popcount(x): #xは10進数の整数
    return bin(x).count('1')
def count(n):
    ans = 0
    while n:
        ans += n % 2
        n //= 2
    return ans
ma = 2*10**5
dp = [0] * ma
for i in range (1, ma):
    dp[i] = dp[i % count(i)] + 1
def solve(N, x):
    p = popcount(int(x, 2))
    nowp_p = int(x, 2) % (p+1)
    if p-1 != 0: 
        nowp_m = int(x, 2) % (p-1)
    x = list(x)#list
    for i in range(N):
        if x[i] == '0':
            print(dp[(nowp_p + 2**(N-i-1)) % (p + 1)] + 1)
        elif x[i] == '1':
            if p == 1:
                print(0)
            else:
                print(dp[(nowp_m - 2**(N-i-1) + p - 1) % (p - 1)] + 1)
N = int(input())
x = input() #str
solve(N, x)

Submission status: Runtime Error

Solution code:
n=int(input())
ans=0
cnt=[0]*500000
print(2*10**2)
for i in range(1,2*10**2+1):
    for j in range(1,2*10**2+1):
        for k in range(1,2*10**2+1):
            cnt[((i+j)**2+(j+k)**2+(k+i)**2)//2-1]+=1
for i in range(n):
    print(cnt[i])

Submission status: Runtime Error

Solution code:
L=input()
R=input()
d=input()
for i in range(L,R):
  if i%d==0:
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
L=input()
R=input()
d=input()
for i in range(L,R);
  if i%d==0;
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
L=input();
R=input();
d=input();
for i in range(L,R);
  if i%d==0;
    count+=1;
print(count);

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v = i*i+j*j+k*k+i*j+j*k+k*i;
      if v<10050:
        ans[v]+=1

for i in range(n):
  print(ans[i+1])

Submission status: Runtime Error

Solution code:
L, R, d = input().split(' ')
ans = 0
for i range((L//d+1),R,d):
  ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
	for j in range(1,105):
		for k in range(1,105):
			v = i*i+j*j+k*k+i*j+j*k+k*i;
			if v<10050:
				ans[v]+=1
for i in range(n):
	print(ans[i+1])

Submission status: Runtime Error

Solution code:
l,r,d = map(int,input.split())
print((l-r+1) // d)

Submission status: Runtime Error

Solution code:
l,r,d=map(int,input.split())
print((l-r+1)//d)

Submission status: Runtime Error

Solution code:
l,r,d = map(int,input().split())
print((r//d - l//d)

Submission status: Runtime Error

Solution code:
l,r,d = map(str,input.split())
l = int(l)
r = int(r)
d = int(d)
print((r-l+1)//d)

Submission status: Runtime Error

Solution code:
l,r,d = map(int,input.split())
print((r-l+1)//d)

Submission status: Runtime Error

Solution code:
l,r,d = map(int,input.split())
print((l-r+1)//d)

Submission status: Runtime Error

Solution code:
l,R, d = map(int, input()).split()

a =0
for i in range(l,R):
  if i % d == 0:
    a = a+1 

print(a)

Submission status: Runtime Error

Solution code:
N=int(input())
for n in range(1,N+1):
    s=0
    for x in range(1,50):  
        for y in range(x,50):
            for z in range(y,50):
                fn=x*x+y*y+z*z+x*y+y*z+z*x
                if fn==n and x==y and x==z:
                    s=s+1
                if fn==n and x<y and y==z:
                    s=s+3
                if fn==n and x==y and y<z:
                    s=s+3              
                if fn==n and x<y and y<z:
                    s=s+6    
    print(s)

Submission status: Runtime Error

Solution code:
N=int(input())
for n in range(1,N+1):
    s=0
    for x in range(1,101):
        for y in range(x,101):
            for z in range(y,101):
                fn=x*x+y*y+z*z+x*y+y*z+z*x
                if fn==n and x==y and x==z:
                    s=s+1
                if fn==n and x<y and y==z:
                    s=s+3
                if fn==n and x==y and y<z:
                    s=s+3              
                if fn==n and x<y and y<z:
                    s=s+6    
    print(n,s)

Submission status: Runtime Error

Solution code:
L, R, d = map(int, input().split())

count = 0
for i in range(L, R+1):
  if i % d == 0:
    count += 1
    
return count

Submission status: Runtime Error

Solution code:
ans = 0
for i in range(L, R):
  if i % d == 0:
    ans += 1
return ans

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(int,map(input().split())
i = 0
for z in range(N)         
	for x,y in enumerate a:
         b=x+1
		 if b%2!=0 and y%2!=0:
    		i+=1
print(i)

Submission status: Runtime Error

Solution code:
def solve(L,R,d):
    count = 0
    for i in range(L,R+1):
        if i % d == 0:
            count += 1
    return count
L, R, D = map(int, input().split())
print(solve(L,R,d))

Submission status: Runtime Error

Solution code:
L, R, d = map(int, input().split(" "))

tmp = (R-L+1)/d
if tmp < 1 :
    if (d >= L) & (d <= R):
        count1 = 1
else:
    count1 = tmp

print(int(count1))

Submission status: Runtime Error

Solution code:
N = input()
a = list(map(input(),range(1,N+1)))
i = 0
for x,b in enumerate(a):
	x=x+1  
	if x%2!=0 and b%2!=0:
    	i+==1
     
    print(i)

Submission status: Runtime Error

Solution code:

correct=[]
for i in range(L,R+1):
  if i%d==0:
    correct.append(i)

Submission status: Runtime Error

Solution code:
L,R,d = map(int, input().split())

minumum = math.ceil(L/d)
maximum = R//d

if maximum - minumum >=0:
    print(maximum - minumum+1)
else:
    print(0)

Submission status: Runtime Error

Solution code:
l,r,d = map(int, input().split())
var=l//d
var1=r//d
ans=var1-var
if l%d==0:
ans+=1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def collatx(i):
    cnt=0
    while i!=1:
        cnt+=1
        if i%2==0:
            i//=2
        else:
            i*=3
            i+=1
    return cnt

def main():
    n=int(input())
    acc=0
    for i in range(1,n+1):
        acc+=collatx(i)
        acc%=1000000007
    print(acc)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import sys
N = int(sys.stdin.readline())
a_list = list(map(int, sys.stdin.readline().split()))

result = 0
for index in range(N):
    if (index + 1) % 2 == 1:
        if a_list[index] % 2 == 1:
            result += 1
        
print(result)

Submission status: Runtime Error

Solution code:
import sys
L,R,d = int(sys.stdin.readline())
# L=5
# R=10
# d=2
result = 0
for index in range(L,R+1):
    if index % d == 0:
        result += 1
        
print(result)

Submission status: Runtime Error

Solution code:
N = int(input())
X = str(input())

def popcount(X):
  counter = 0
  for i in range(N):
    if X[i] == "1":
      counter += 1
  return counter

    
def converter(N,X):
  conv_counter = 0
  for i in range(N):
    conv_counter += int(X[i])*(2**((N-1)-i))
  return conv_counter

def decorder(N,X):
  #10進数のXをＮ桁の2進数に直す
  reslist = []
  for i in range(N):
    p = int(X) // 2**((N-1)-i)
    reslist.append(str(p))
    X = str(int(X) - p*(2**((N-1)-i)))
  #print("reslist",reslist)
  res = "".join(reslist)
  return res

def bit_change(X,P):
  LISTX = list(X)
  change_num = abs(int(X[P])-1)
  LISTX[P] = str(change_num)
  X = "".join(LISTX)
  return X


def main(N,X):
  for i in range(N):
    result = 0
    #二進数のBIT変換
    target = bit_change(X,i)
    #print("target",target)
    
    if converter(N,target) == 0:
      flag = 0
    else:
      flag = 1
    #print("flag:",flag)
    
    while flag == 1:
      result += 1
      pop_count = popcount(target)
      conv = converter(N,target)
      target_10 = conv % pop_count
      
      if target_10 == 0:
        flag = 0
        
      else:
        target = decorder(N,target_10)
	  
    print(result)
    
main(N,X)
    
#print(decorder(N,X))

Submission status: Runtime Error

Solution code:
S = int(input().split())
counter = 0
for _ in range (S[0],S[1]):
  if _ % S[2] == 0:
    counter += 1
  
print(counter)

Submission status: Runtime Error

Solution code:
n = int(input())
a = [0] * 10**5
for x in range(1, 101):
	for y in range(1, 101):
		for z in range(1, 101):
			a[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1
for i in range(1, n + 1):
	print(a[i])

Submission status: Runtime Error

Solution code:
L = int(input())
R = int(input())
d = int(input())
i=0
for x in range (L,R+1):
    if x%2==0:
        i+=1
print(i)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split())) 
 
ans = 0

for i in range(0,n,2):
  if a[i] % 2 == 1:         
    ans += 1 
print(ans)

Submission status: Runtime Error

Solution code:
l, r, d = int(input())
count = 0
for i in range(l, r+1):
  if i % d == 0:
    count += 1
    continue

Submission status: Runtime Error

Solution code:
l, r, d = map(int, input())
count = 0
for i in range(l, r+1):
  if i % d == 0:
    count += 1
    continue

Submission status: Runtime Error

Solution code:
n = int(input())
count = 0
for i in range(1,n+1):
  if(n%i==0):
    count += 1
    continue

Submission status: Runtime Error

Solution code:
import numpy
import math
 
L, R, d = input().split()
 
N = R/d
 
n = 0  # 切り捨てしたい桁
y = math.floor(L * 10 ** n) / (10 ** n)
 
print(math.floor(y))

Submission status: Runtime Error

Solution code:
import numpy
 
L, R, d = input().split()
 
N = R/d

n = 0  # 切り捨てしたい桁
y = math.floor(L * 10 ** n) / (10 ** n)

print(math.floor(y))

Submission status: Runtime Error

Solution code:
import numpy
 
L, R, d = input().split()
 
N = R/d
 
print(math.floor(N))

Submission status: Runtime Error

Solution code:
import numpy
 
a = input().split()
L = a(0)
R = a(1)
d = a(2)
 
N = R/d
 
print(math.floor(N))

Submission status: Runtime Error

Solution code:
import numpy

a = input().split()
L = a[0]
R = a[1]
d = a[2]

N = R/d

print(math.floor(N))

Submission status: Runtime Error

Solution code:
[][0]

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
for j in range(1,105):
for k in range(1,105):
v = i*i+j*j+k*k+i*j+j*k+k*i;
if v<10050:
ans[v]+=1
for i in range(n):
print(ans[i+1])

Submission status: Runtime Error

Solution code:
numbers = map(int, input().split())
number_list = [i+numbers[0] for i in range(numbers[1]-numbers[0])]
count = 0
for i in numbers_list:
  if number_list % numbers[2] == 0:
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
	for j in range(1,105):
		for k in range(1,105):
			v = i*i+j*j+k*k+i*j+j*k+k*i;
			if v<10050:
				ans[v]+=1

for i in range(n):
	print(ans[i+1])

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
	for j in range(1,105):
		for k in range(1,105):
			v = i*i+j*j+k*k+i*j+j*k+k*i;
			if v<10050:
				ans[v]+=1
                
for i in range(n):
	print(ans[i+1])

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
    for j in range(1,105):
        for k in range(1,105):
            v=i*i+j*j+k*k+i*j+j*k+k*i;
            if v<10050:
            	ans[v]+=1
for i in range(n):
	print(ans[i+1])

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for _in range(10050)]
for i in range(1,105):
    for j in range(1,105):
        for k in range(1,105):
            v=i*i+j*j+k*k+i*j+j*k+k*i;
            if v<10050:
            	ans[v]+=1
for i in range(n):
	print(ans[i+1])

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for _ in range(10050)]
	for i in range(1,105):
    	for j in range(1,105):
        	for k in range(1,105):
            	v=i*i+j*j+k*k+i*j+j*k+k*i;
              	if v<10050:
                  ans[v]+=1
 
for i in range(n):
	print(ans[i+1])

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(0 for i in range(1,n+1))
for i in range(1,100):
  for j in range(1,100):
    for k in range(1,100):
      if n < i*i+j*j+k*k+i*j+j*k+i*k:
        break;
      l[(i*i+j*j+k*k+i*j+j*k+i*k)-1]+=1
      #print(i*i+j*j+k*k+i*j+j*k+i*k)

for i in l:
  print(i)

Submission status: Runtime Error

Solution code:
l, r, d = map(int, input())
print(r // d - (l - 1) // d)

Submission status: Runtime Error

Solution code:
from collections import defaultdict
n=int(input())
MAX=10001
RMAX=102
d = defaultdict(int)
for i in range(1,RMAX):
    wkx = i * 1
    if wkx > MAX:
        break
    for j in range(1,RMAX):
        wky = wkx + j * j  + i * j
        if wky > MAX :
            break
        for k in range(1,RMAX):
            wkz = wky + k * k + i * k  + j * k
            if wkz > MAX :
                break
            d[wkz] += 1
            
for i in range(n):
    k = i + 1
    print(d[k])

Submission status: Runtime Error

Solution code:
from collections import defaultdict
n=int(input())
MAX=10000

d = defaultdict(int)

def col(x,y,z):
    if x == y and x == z  :
        return 1
    if x == y or y == z or z == x :
        return 3
    return 1     

# x <= y <= z
for i in range(1,MAX):
    wkx = i * i
    if wkx > MAX:
        break
    for j in range(i,MAX):
        wky = wkx + j * j  + i * j
        if wky > MAX :
            break
        for k in range(j,MAX):
            wkz = wky + k * k + i * k  + j * k
            if wkz > MAX :
                break
            d[wkz] = d[wkz] + col(i,j,k)
            
for i in range(n):
    k = i + 1
    print(d[k])

Submission status: Runtime Error

Solution code:
N, M ,L = map(int, input().split())
print((M//L-(N-1)//L)

Submission status: Runtime Error

Solution code:
l,r,d=map(int.input().split())
print(r//d-(l-1)//d)

Submission status: Runtime Error

Solution code:
map(int,input().spilit())
print(r//d-(l-1)//d)

Submission status: Runtime Error

Solution code:
s = input().split(" ")
L = int(s[0])
R = int(s[1])
d = int(s[2])
cnt = 0
for i in range(L:R+1):
  if i%d == 0:
    cnt += 1
print(cnt)

Submission status: Runtime Error

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

if 
print(int(b/c) - int(a-1/c))

Submission status: Runtime Error

Solution code:
import math
num_limit = int(input())
s_limit_1 = int(num_limit**0.5)
s_limit_2 = int((num_limit/2)**0.5)
s_limit_3 = int((num_limit/3)**0.5)
for i in range(1,num_limit+1):
    xyz_list = []
    xyz_count = 0
    s_limit_1 = int(i ** 0.5)
    j = 0
    k = 0
    l = 0
    for j in range(1,s_limit_1+1):
        for k in range(1,j+1):
            if i <= j**2 + k**2 + l**2 + j*k + k*l + l*j:
                break
            for l in range(1,k+1):
                if i == j**2 + k**2 + l**2 + j*k + k*l + l*j:
                    if j == k and k == l:
                        xyz_count += 1
                    elif j == k and k > l or j > k and k == l:
                        xyz_count += 3
                    else:
                        xyz_count += 6
                if i < j**2 + k**2 + l**2 + j*k + k*l + l*j:
                    break
    print(xyz_count)

Submission status: Runtime Error

Solution code:
, r, d = map(int, input().split())
cnt = 0
for i in range(l, r+1):
  if i%d == 0:
    cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def popcnt(n):
    return bin(n).count("1")


def mod(n, cnt):
    if n == 0:
        return cnt
    n = n % popcnt(n)
    cnt += 1
    return mod(n, cnt)


n = int(readline())
x2 = list(readline().decode().rstrip())
x10 = int(''.join(x2), 2)

c = x2.count('1')
mod1 = x10 % (c + 1)
mod2 = x10 % (c - 1) if c - 1 != 0 else 0

for i in range(n):
    if x2[i] == '0':
        t = (mod1 + pow(2, n - i - 1, c + 1)) % (c + 1)
    else:
        if c - 1 != 0:
            t = (mod2 - pow(2, n - i - 1, c - 1)) % (c - 1)
        else:
            print(0)
            continue
    print(mod(t, 1))

Submission status: Runtime Error

Solution code:
l, r, d = input().split()
print(r//d -(l-1)//d)

Submission status: Runtime Error

Solution code:
l, r, d = input().split()
t1 = int(r/d)
t2 = int(l/d)
print(t1-t2)

Submission status: Runtime Error

Solution code:
l,r,d=map(int、input())
print(r//d - l//d)

Submission status: Runtime Error

Solution code:
from heapq import *

def solve(p:list):
    s = 0
    n = len(p)
    data = [[] for _ in range(n+1)]
    for i,j in p:
        data[min(i,n)].append(j)
    H = []
    heapify(H)
    for i in range(n,0,-1):
        for j in data[i]:
            heappush(H,-j)
        if H:
            s -= heappop(H)
    return s
    
t = int(input())
for _ in range(t):
    n = int(input())
    ans = 0
    pl = []
    pr = []
    for _ in range(n):
        k,l,r = map(int,input().split())
        m = min(l,r)
        ans += m
        l,r = l-m,r-m
        if l:
            pl.append((k,l))
        else:
            pr.append((n-k,r))
    print(ans+solve(pl)+solve(pr))

Submission status: Runtime Error

Solution code:
 map(int,input(),split())
 
cnt=0
for i in range(l,r+1):
  if i % d ==0:
    cnt= cnt+1
  
  
  
  print(cnt)

Submission status: Runtime Error

Solution code:
L,R,d = (int(x) for x in input().split())

for i in range(R):
    if d*i>=R:
      max=i
      break

for i in range(L):
    if d*i>=L:
        min=i-1
        break

print(str(max-min))

Submission status: Runtime Error

Solution code:
L,R,d = (int(x) for x in input().split())

for i in range(R):
    if d*i>=R:
      max=i
      break

for i in range(L):
    if d*i>L:
        min=i
        break

print(str(max-min))

Submission status: Runtime Error

Solution code:
L=input("始まりの数")
L=int (L)
R=input("終わりの数")
R=int (R)
d=input("倍数の元となる数")
d=int(d)
for i in range(R):
    if d*i>=R:
      max=i
      break

for i in range(L):
    if d*i>=L:
        min=i
        break

print(str(max-min))

Submission status: Runtime Error

Solution code:
N = int(input())
X = int(input(), 2)

f = {}


def calcF(i, count):
    if i == 0:
        return count
    if i in f:
        return count + f[i]
    icount = bin(i).count("1")
    if icount == 0:
        return count + 1
    r = i % icount
    if r != 0:
        return calcF(r, count + 1)
    else:
        return count + 1


for i in range(1, 2 ** N):
    f[i] = calcF(i, 0)

for i in range(1, N + 1):
    a = X ^ 2 ** ((N - 1) - (i - 1))
    if a == 0:
        print(0)
    else:
        print(f[a])

Submission status: Runtime Error

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

for i in range(a[0,a[1]+1]):
    if i % a[2] == 0:
        counter += 1
print(counter)

Submission status: Runtime Error

Solution code:
L, R, d = input()
count = 0
for i in range(int(L)+1, int(R)+1):
  if i % int(d) == 0:
    count = count + 1
print(count)

Submission status: Runtime Error

Solution code:
L, R, d = input().split()

L = int()
R = int()
d = int()

ans = 0

for i in range(L, R+1):
    if i % d == 0:
        ans = ans + 1
        
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

lst = [0]*n
a = int(n ** 0.5)

for x in range(1, a):
    for y in range(1, a):
        for z in range(1, a):
            b = x**2 + y**2 + z**2 + x*y + y*z + z*x
            while b <= n:
                lst[b - 1] += 1

for i in lst:
    print(i)

Submission status: Runtime Error

Solution code:
n=int(input())
ans=[0]*(10001)
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      index=i**2+j**2+k**2+i*j+j*k+i*k
      if index<10000:
        ans[index]+=1
     
for i in range(1,n+1):
  print(ans[i])

Submission status: Runtime Error

Solution code:
L=int(input())
R=int(input())
d=int(input())
count=int(0)
for i in range(L,R):
    if i%d==0:
        count+=1
print(count)

Submission status: Runtime Error

Solution code:
L,R,d=map(int,input().split())
ans=0

for i in range(L,R+1):
    if i%d==0:
        ans+=1
print(ans)


L,R,d=map(int,input().split())
ans=0

for i in range(R-L):
    if (L+i)%d==0:
        ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
L=int(input())
R=int(input())
d=int(input())
count=int(0)
for i in range(L,R):
    if i%d==0:
        count+=1
print count

Submission status: Runtime Error

Solution code:
l,r,d = list(map(int,input()split()))
print(r//d-(l-1)//d)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
    int l, r, d;
    cin >> l >> r >> d;
    int ans = 0;
    for (int i = l; i < r + 1; i++) {
        if (i % d == 0) {
            ans++;
        }
    }
    cout << ans << endl;
}

Submission status: Runtime Error

Solution code:
def mpow(a,b,m):
    ans=1
    while b >0 :
        if b&1:
            ans = (ans*a)%m
        a=(a*a)%m
        b=b>>1

    return ans

def calcmod(X,m,N):
    mod=0
    for i in range(N+1):
        if X&(1<<i) > 0:
            mod += mpow(2,i,m)
            mod%=m
    return mod

def popcount(m):
    return bin(m).count("1")


def findsteps(mm):
    cnt=0
    while mm !=0:
        cnt+=1
        mm=mm%popcount(mm)
    return cnt
N=int(input())
X=int(input(),2)

##we need to find X%(m-1) and X%(m+1)
m=popcount(X)
m1=m+1
m2=m-1
firstmod=calcmod(X,m1,N)
if m2 !=0:
    secondmod=calcmod(X,m2,N)
fans=[0 for i in range(N)]
k=0
for i in range(N-1,-1,-1):
    if X & (1<<i) >0:
        ##the bit was set
        ##we need to find X%(m-1) - (2^i)%(m-1)
        if m2 == 0:
            ans=0
        else:
            mm=secondmod - mpow(2,i,m2)
            if mm < 0:
                mm+=m2
            mm=mm%m2
            ans=1+findsteps(mm)
    else:
        mm = firstmod + mpow(2,i,m1)
        mm=mm%m1
        ans=1+findsteps(mm)
    fans[k] = ans
    k+=1
        ##the bit was not set
for i in fans:
    print(i)

Submission status: Runtime Error

Solution code:
import math

n = int(input())

ans = [0 for _ in range(10001)]

for i in range(1,math.ceil(math.sqrt(n))):
    for j in range(1,math.ceil(math.sqrt(n))):
        for k in range(1,math.ceil(math.sqrt(n))):
            v = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if(v < 10001):
                ans[v] += 1

for i in range(n):
    print(ans[i+1])

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())

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

Submission status: Runtime Error

Solution code:
N = int(input())
X = input()

xn = X.count('1')
x10 = int(X,2)

def f(one, ten):
    c = 0
    while ten:
        c += 1
        ten %= one
        one = str(bin(ten)).count('1')
    print(c)


for i,j in enumerate(X):
    k = N - 1 - i
    if j == '1':
        f(xn - 1, x10 - (2**k))
    elif j == '0':
        f(xn + 1, x10 + (2**k))

Submission status: Runtime Error

Solution code:
N = int(input())



for n in range(1,N+1):
    if n < 6:
        print(0)
    else:
        M =int((n-2)**0.5)
        count = 0
        for x in range(1,M+1):
            #P=x**2+y**2+z**2+x*y+y*z+z*x
            for y in range(1,M+1):
                #Q=x**2+y**2+z**2+x*y+y*z+z*x
                for z in range(1,M+1):
                    #R = x**2+y**2+z**2+x*y+y*z+z*x
                    if x**2+y**2+z**2+x*y+y*z+z*x == n:
                        count = count + 1
                    else:
                        pass
        print(count)

Submission status: Runtime Error

Solution code:
N = int(input())


for n in range(1,N+1):
    if n < 3:
        print(0)
    else:
        M =int((n-2)**0.5)
        count = 0
        for x in range(1,M+1):
            #P=x**2+y**2+z**2+x*y+y*z+z*x
            for y in range(1,M+1):
                #Q=x**2+y**2+z**2+x*y+y*z+z*x
                for z in range(1,M+1):
                    #R = x**2+y**2+z**2+x*y+y*z+z*x
                    if x**2+y**2+z**2+x*y+y*z+z*x == n:
                        count = count + 1
                    else:
                        pass
        print(count)

Submission status: Runtime Error

Solution code:
from heapq import heappop, heappush

t = int(input())
for i in range(t):
  n = int(input())
  klr = [list(map(int, input().split())) for i in range(n)]
  plus = []
  p_que = []
  minus = []
  m_que = []
  ans = 0
  for key, (k,l,r) in enumerate(klr):
    diff = l-r
    if diff >= 0:
      plus.append([k, diff, key])
      heappush(p_que,(diff, k, key))
      ans += r
    else:
      minus.append([k, -diff, key])
      heappush(m_que,(-diff, k, key))
      ans += l
  plus.sort(reverse=True)
  used = [0] * n
  now = len(plus)
  for k,diff,key in plus:
    while now > k:
      data = heappop(p_que)
      idx = data[2]
      if used[idx]:
        continue
      used[idx] = 1
      now -= 1
    if used[key]:
      continue
    used[key] = 1
    ans += diff
    now -= 1
  now = len(plus) + 1      
  minus.sort()
  for k,diff,key in minus:
    while now <= k:
      data = heappop(m_que)
      idx = data[2]
      if used[idx]:
        continue
      used[idx] = 1
      now += 1
    if used[key]:
      continue
    used[key] = 1
    ans += diff
    now += 1
  print(ans)

Submission status: Runtime Error

Solution code:
l,r,d = map(int,input().split())
  ans = 0
  for i in (l, r + 1):
	if i % d == 0 :
		ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
from sys import stdin
a,b,c = int(stdin.readline().rstrip().split())
a = b/c - a/c
print(a)

Submission status: Runtime Error

Solution code:
from sys import stdin
  a,b,c = int(stdin.readline().rstrip().split())
  a = (a - a%c)/c
  b = (b - b%c)/c
  a = b - a
  print(a)

Submission status: Runtime Error

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

main()

Submission status: Runtime Error

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

main()

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int l,r,d;
  cin >> l >> r >> d;
  int a = 0;
  for(int i = l; i < r+1; i++){
    if(i % d == 0)  a++;
  }
  cout << a << endl;
}

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    res = [0]*(n+1)

    for i in range(1,100):
        for j in range(1,100):
            for k in range(1,100):
                if(i**2 + j**2 + k**2 +i*j+j*k + k*i<=n):
                    res[i**2 + j**2 + k**2 +i*j+j*k + k*i]+=1
                    
    for i in range(1,n+1):
        print(res[i])
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007

#+++++

dd={}
def get_f(v):
	global dd
	if v == 0:
		return 0
		
	if v in dd:
		return dd[v]
	
	pn = bin(v).count('1')
	ret = 1+get_f(v % pn)
	dd[v] = ret
	return ret
	
def bb(n, s):
	saigo = int(s[-1])
	for i, c in enumerate(s[:-1]):
		if c == '0':
			print(get_f(saigo)+1)
		else:
			print(0)
	if saigo == '0':
		print(get_f(1)+1)
	else:
		print(0)
		

def main():
	n = int(input())
	#b , c = tin()
	s = input()
	sa=s[::-1]
	n_one=s.count('1')
	if n_one == 1:
		bb(n,s)
		return 
	#pa(n_one)
	#pa(s)
	amari_p = 0
	amari_n = 0
	for i, c in enumerate(sa):
		if c == '1':
			amari_p += pow(2,i,n_one+1)
			amari_n += pow(2,i,n_one-1)
			amari_p %= n_one+1
			amari_n %= n_one-1
		
	#pa(amari_p)
	#pa(amari_n)
	for i, c in enumerate(s):
		keta = n - i - 1
		if c == '1':
			ta = amari_n
			ta -= pow(2,keta,n_one-1)
			ta %= n_one-1
		else:
			ta = amari_p
			ta += pow(2, keta, n_one+1)
			#pa(('q',ta))
			ta %= n_one+1
		#pa((keta,pow(2,keta),ta))
		print(get_f(ta)+1)
		
		
	
		
	
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)