Problem:
 Score : 600 points    Problem Statement We have a sequence of length N consisting of non-negative integers. Consider performing the following operation on this sequence until the largest element in this sequence becomes N-1 or smaller.   Determine the largest element in the sequence (if there is more than one, choose one). Decrease the value of this element by N , and increase each of the other elements by 1 .   It can be proved that the largest element in the sequence becomes N-1 or smaller after a finite number of operations.  You are given an integer K . Find an integer sequence a_i such that the number of times we will perform the above operation is exactly K . It can be shown that there is always such a sequence under the constraints on input and output in this problem.      Constraints  0 ≤ K ≤ 50 \times 10^{16}         Input Input is given from Standard Input in the following format:  K       Output Print a solution in the following format:  N  a_1  a_2 ... a_N   Here, 2 ≤ N ≤ 50 and 0 ≤ a_i ≤ 10^{16} + 1000 must hold.        Sample Input 1 0      Sample Output 1 4
3 3 3 3       Sample Input 2 1      Sample Output 2 3
1 0 3       Sample Input 3 2      Sample Output 3 2
2 2  The operation will be performed twice: [2, 2] -> [0, 3] -> [1, 1].       Sample Input 4 3      Sample Output 4 7
27 0 0 0 0 0 0       Sample Input 5 1234567894848      Sample Output 5 10
1000 193 256 777 0 1 1192 1234567891011 48 425

Solution (Python):
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]

k=int(input())
if k==0:
    print(2)
    print("1 1")
elif k==1:
    print(2)
    print("2 0")
elif k>=50:
    syou=k//50
    amari=k%50
    print(50)
    lst=[49+syou-1]*50
    lst[0]+=1
    for i in range(50):
        if i<amari:
            lst[i]+=50-amari+1
        else:
            lst[i]-=amari
    print(" ".join(map(str,lst)))
else:
    print(k)
    lst=[[] for i in range(k)]
    lst[0]=k
    for i in range(k-1):
        lst[i+1]=k-1
    print(" ".join(map(str,lst)))

Solution (Python):
k = int(input())
L = [49]*50
t = k//50
for i in range(50):
    L[i] += t
m = k%50
for i in range(m):
    for j in range(50):
        if i == j:
            L[j] += 50
        else:
            L[j] -= 1
print(50)
print(' '.join(map(str, L)))

Solution (Python):
k = int(input())
L = [49]*50
t = k//50
for i in range(50):
    L[i] += t
m = k%50
for i in range(m):
    for j in range(50):
        if i == j:
            L[j] += 50
        else:
            L[j] -= 1
print(50)
print(' '.join(map(str, L)))

Solution (Python):
import sys,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

n = onem()
print(50)
a = [49 - i + n//50 for i in range(50)]

if n%(50) == 0:
    print(jo(a))
else:
    for i in range(50):
        if n%(50) >= i+1:
            a[i] += 1
        
    print(jo(a))

Solution (Python):
import sys
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

k = ni()
n = 50

a = k//n
b = k%n
c = n-1+a

ans = [str(c+n-b+1)]*b + [str(c-b)]*(n-b)

print(n)
print(' '.join(ans))

Solution (Python):
k = int(input())
N = 50
mk = k%N
qk = k//N
ans = [2*N + qk - mk]*mk + [N + qk - mk - 1]*(N - mk)
print(N)
print(' '.join([str(i) for i in ans]))

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby
    
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

    k = int(input())
    n = 50
    s = k // n
    amari = k % n
    res = list(range(n-1, -1, -1))
    for i in range(n):
        res[i] += s
    cnt = 0
    while cnt < amari:
        cnt += 1
        res[-cnt] += n+1
        for i in range(n):
            res[i] -= 1
    print(n)
    print(*res)

if __name__ == '__main__':
    main()

Solution (Python):

k = int(input())
x = -(-k // 50)
y = x * 50 - k
a = [i+(x-1) for i in range(1, 51)]
for _ in range(y):
    a.sort()
    for i in range(50):
        a[i] += 1
    a[-1] -= 51
a.sort()
print(50)
print(*a)

Solution (Python):
K = int(input())
N = 50
A = [i for i in range(N)]
q, r = divmod(K, N)
for i in range(N): A[i] += q
for i in range(r):
    for j in range(N):
        if j == i: A[j] += N
        else: A[j] -= 1
print(N)
print(*A)

Solution (Python):
K = int(input())
N = 50
A = [i for i in range(N)]
q, r = divmod(K, N)
for i in range(N): A[i] += q
for i in range(r):
    for j in range(N):
        if j == i: A[j] += N
        else: A[j] -= 1
print(N)
print(*A)

Solution (Python):


def main():
    k = int(input())
    n = 50
    a = list(range(n))
    for i in range(n):
        a[i] += k // n
    for i in range(k % n):
        a[n - i - 1] += 1
    print(n)
    print(" ".join(str(x) for x in a))

if __name__ == "__main__":
    main()

Solution (Python):
k= int(input())
l = [i+(k//50) for i in range(51)]
del l[50-k%50]
print(50)
print(*l)

Solution (Python):
K = int(input())
N = 50
a = [N-1+K//N]*N
idx = 0

for _ in range(K%N):
    for i in range(N):
        if i==idx:
            a[i] += N
        else:
            a[i] -= 1

    idx += 1

print(N)
print(*a)

Solution (Python):
K = int(input())

N = 50
ans = [K // N + N] * (K % N) + [K // N + N - K % N - 1] * (N - K % N)
print(N)
print(*ans)

Solution (Python):
K = int(input())
N = 50

x, y = divmod(K, N)
base = 49 + x
rest = y
A = [None] * N
for i in range(N):
    A[i] = base - rest + (rest >= N - i) * (N + 1)

print(N)
print(*A)

Solution (Python):
k=int(input())
print(50)
p=k//50
q=k%50
ans=[49-(q-1)+p+50]*q+[49-q+p]*(50-q)
print(*ans)

Solution (Python):
k = int(input())
rem = k%50
quo = k//50

N = 50
A = [49+quo]*N

for i in range(50):
    if i < rem:
        A[i] += 50-(rem-1)
    else:
        A[i] -= rem

print(N)
print(*A)

Solution (Python):


K=int(input())


alpha=K//50
beta=K%50


N=50
A=[49+alpha-beta]*N
for i in range(beta):
    A[i]+=51

print(N)
print(*A)

"""
count=0
for i in range(50):
    if A[i]<50:
        continue
    count+=1
    for j in range(50):
        if i==j:
            A[j]-=N
        else:
            A[j]+=1

print(A)
print(count)
"""

Solution (Python):
k = int(input())
s = [i for i in range(51)]
s.reverse()
a = k % 50
b = k // 50
ans = []
for i in range(51):
    if not i == a:
        ans.append(s[i] + b)
print(50)
print(" ".join(map(str, ans)))

Solution (Python):
k=int(input())
n=50
a=[0 for _ in range(n)]
for i in range(n):
  if i < (k%n):
    a[i]=n
  else:
    a[i]=n-1-k%n
for i in range(n):
  a[i]+=(k//n)
print(n)
for i in range(n):
  if i==n-1:
    print(a[i])
  else:
    print(a[i],end=" ")

Solution (Python):
K = int(input())

N0 = K % 50
A = K//50+49
a = [0] * 50

for i in range(0,50-N0):
    a[i] = A - N0
for i in range(50-N0,50):
    a[i] = A - N0 + 51

print(50)
print(" ".join(list(map(str,a))))

Solution (Python):
k = int(input())

n = 50
ans = [i for i in range(n)]

for i in range(n):
    ans[i] += k // n

for i in range(k % n):
    ans[i] += n
    for j in range(n):
        if i == j:
            continue
        ans[j] -= 1

print(n)
a = [str(x) for x in ans]
print(' '.join(a))

Solution (Python):
K=int(input())
q=K//50
r=K%50
A=[49+q-r for i in range(50-r)]
B=[100+q-r for i in range(r)]
ans=A+B
print(50)
print(*ans)

Solution (Python):
K = int(input())
N = 50

a = [i for i in range(N)]
a = [x + K // N for x in a]
for i in range(K % N):
    a = [x - 1 for x in a]
    a[i] += N + 1

print(N)
print(*a)

Solution (Python):
import sys
input = sys.stdin.readline
INF = 10**20
MOD = 10**9 + 7

def main():
    k = int(input())
    print(50)

    l = (k + 49) // 50
    mod = k % 50
    ans = [l] * 50

    for i in range(50):
        ans[i] += 50 - i - 1
    
    if mod != 0:
        for i in range(50 - mod):
            for j in range(50):
                if i == j:
                    ans[j] -= 50
                else:
                    ans[j] += 1
    print(*ans)

if __name__=='__main__':
    main()

Solution (Python):
K=int(input())
a=K%50
b=K//50
l=[49+b-a]*(50-a)+[100+b-a]*a
print(50)
print(*l)

Solution (Python):
k = int(input())

n = 50
a = list(range(50))
base = k // n
r = k % n
for i in range(n):
    a[i] += base
for i in range(r):
    a[n-1-i] += 1
ans = a[n-r:] + a[:n-r]
print(n)
print(*ans)

Solution (Python):
K = int(input())
N = 50
q, r = divmod(K, N)
A = [N + q - r - 1] * (N - r) + [N + q + N - r] * (r)
print(N)
print(*A)

Solution (Python):
K = int(input())
m = K%50
n = K//50
ans = list(range(51-m,51)) + list(range(50-m))
ans = [n+a for a in ans]
print(50)
print(*ans)

Solution (Python):
k = int(input())
n = min(50,k)
if n == k:
    if k >= 2:
        l = [n-1 for i in range(n)]
        l[0] = n
    elif k == 1:
        n = 2
        l = [0,2]
    else:
        n = 2
        l = [0,0]
else:
    a = k//n
    b = k%n
    l = []
    for i in range(n):
        l.append(n-i)
    
    for i in range(n):
        l[i] += a-1
    for i in range(b):
        l[i] += 1
print(n)
for i in l:
    print(i,end=" ")

Solution (Python):
"""from collections import *
from itertools import *
from bisect import *
from heapq import *

import math
from fractions import gcd
import sys


import copy"""

K=int(input())
N=50
A=[0 for i in range(N)]


if K<=49:
	A[0]=49+K*50
else:
	A=[i for i in range(1,N+1)]
	K-=50
	for i in range(50):
		A[i]+=K//50
	for i in range(K%50):
		A[49-i]+=1


print(50)
print(" ".join([str(i) for i in A]))
"""
count=0
while 1:

	idx=[i for i in range(50) if A[i]==max(A) and A[i]>=50]
	if not idx:
		break
	i=idx[0]
	A[i]-=50
	for m in range(50):
		if i!=m:
			A[m]+=1
	count+=1
print(A)
print(count)
"""

Solution (Python):
k = int(input())
l = [(k//50)+49]*50
v = k%50

for i in range(v):
    l[i] += 51-v
for j in range(v, 50):
    l[j] -= v

print(50)
print(*l)

Solution (Python):
k = int(input())

l = [(k//50)+49]*50
if k%50:
    for i in range(k%50):
        l[i] += 51-k%50
    for j in range(k%50, 50):
        l[j] -= k%50

print(50)
print(*l)

Solution (Python):
k = int(input())

size = 50
l = [(k//size)+size-1]*size
if k%size:
    for i in range(k%size):
        l[i] += size-(k%size-1)
    for j in range(k%size, size):
        l[j] -= k%size

print(size)
print(*l)

Solution (Python):

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))



        

def main():
    mod=10**9+7
    K=I()
    if K<=pow(10,16):
        N=2
        if K%2==0:
            ans=[K//2+1,K//2+1]
        else:
            ans=[K//2,K//2+3]
    else:
        N=50
        a=N-1+K//N
        b=K%N
        if b!=0:
            a-=b
        ans=[a]*N
        for i in range(b):
            ans[i]+=N+1
    
        
    print(N)
    print(' '.join(map(str, ans)))
    

        

main()

Solution (Python):
k = int(input())


array = [i for i in range(50)]


plus = k // 50
rem = k % 50
for i in range(50):
    array[i] += plus
for i in range(rem):
    array[i] += 51
    for j in range(50):
        array[j] -= 1
print(50)
print(" ".join(map(str, array)))

Solution (Python):
k = int(input())
A = [x for x in range(50)]

plus = k // 50
A_plus = [x + plus for x in A]

res = k % 50
for i in range(res):
    A_plus = sorted(A_plus)
    A_plus[0] = A_plus[0] + 50
    for j in range(1,50):
        A_plus[j] = A_plus[j] -1

print(50)
print(' '.join([str(x) for x in A_plus]))

Solution (Python):
K = int(input())
N = 50
a = [0] * N
for i in range(K % N):
    a[i] = N-1-K+(N+1)*(K//N+1)
for i in range(K % N, N):
    a[i] = N-1-K+(N+1)*(K//N)
print(N)
print(' '.join(map(str, a)))

Solution (Python):
K = int(input())
N = 50
L = [i+K//N+(K%N+i>=N) for i in range(N)]
print(N)
print(*L)

Solution (Python):

k = int(input())
n = 50
print(n)
p = k // n
q = k % n
a = [49+p for _ in range(50)]
for i in range(q):
  for j in range(50):
    if i == j:
      a[j] += n
    else:
      a[j] -= 1
print(' '.join(list(map(str,a))))

Solution (Python):
k = int(input())
q, r = divmod(k, 50)
L = [q+49]*50
for i in range(r):
  L[i] += 51-r
for i in range(r, 50):
  L[i] -= r
print(50)
print(*L)

Solution (Python):
K = int(input())

def construct(K, N=50):
    As = [N+(K//N-1)-K%N]*50 
    q = K%N
    for q_ in range(q): As[q_] = N+K//N
    print(N)
    print(' '.join(map(str, As)))
    
construct(K)

Solution (Python):
K = int(input())
N = 50
X = K//N
Y = K%N
B = N-1+X-Y
print(N)
print(*[B+N+1 if i<Y else B for i in range(N)])

Solution (Python):
n, k = 50, int(input())
A = list(range(n))

q, r = k // n, k % n
A = [a + q for a in A]
for i in range(r):
    A[i] += n + 1
    A = [a - 1 for a in A]

print(n)
print(*A)

Solution (Python):
def ceil(a,b): return (a+b-1)//b
K=int(input())
print(50)
Y = ceil(K,50)*50
A=[49 + Y//50]*50
for _ in range(Y-K):
    for i in range(49):
        A[i]+=1
    A[-1]-=50
    A.sort()
print(*A)

Solution (Python):
from sys import stdout
printn = lambda x: stdout.write(str(x))
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True 
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

k = inn()
if False and k==0:
    print('2')
    print('0 0')
    exit()
n = 50
p = k//n
r = k%n
if False and p==0:
    print(k+1)
    for i in range(k+1,1,-1):
        printn(str(i)+' ')
    print(0)
    exit()
a = list(range(p+n-1,p-1,-1))
for i in range(r):
    a[i] += 1
print(50)
for i in range(49):
    printn(str(a[i])+' ')
print(a[49])

Solution (Python):
K = int(input())
N = 50
L = [i+K//N+(K%N+i>=N) for i in range(N)]
print(N)
print(*L)

Solution (Python):
import numpy as np
K = int(input())
N = 50
A = np.array([np.zeros(N) for _ in range(N)]).astype(int)
for i in range(N):
    for j in range(N):
        A[i,j] = 1 if j==i+1 else 0
A[N-1,0] = 1
B = [0 for _ in range(N)]
B[0] = np.identity(N).astype(int)
for i in range(1,N):
    B[i] = np.dot(B[i-1],A).astype(int)
C = [0 for _ in range(N)]
C[0] = np.identity(N).astype(int)
for i in range(1,N):
    C[i] = (C[i-1]+B[i]).astype(int)
print(N)
X = np.arange(N)
X = X[::-1].astype(int)
if K==0:
    print(*X)
else:
    r = (K-1)%N
    q = (K-1)//N
    b = [-1 for _ in range(N)]
    b[0] = N
    b = np.array(b).astype(int)
    X = np.dot(X,B[(r+1)%N])
    X += np.dot(b,q*C[N-1]+C[r])
    print(*X)

Solution (Python):
K = int(input())
N = 50
p = K // N
q = K % N
r = N - q
ans = [N-1+p - q]*r + [N-1+p + N-q+1]*q
print(N)
print(*ans)

Solution (Python):
k=int(input())
if k==0:
  print(2)
  print(0,0)
elif k==1:
  print("""3
1 0 3
""")
elif k<=50:
  print(k)
  print(*[k for i in range(k)])
else:
  print(50)
  rep=k//50
  rem=k%50
  l=[]
  for i in range(50):
    if i<rem:
      l.append(50+rep-rem+50)
    else:
      l.append(50+rep-1-rem)
  print(*l)

Solution (Python):
k=int(input())
x=[0]*50
k1=k//50
k2=k%50
for i in range(k2):
    x[k2-i-1]=50-i
for i in range(k2+1,50):
    x[i]=i-k2
for i in range(50):
    x[i]+=k1
print(50)
print(" ".join(map(str,x)))

Solution (Python):
k=int(input())
print(50)
if k==0:
  for i in range(50):
    print(49-i,end=" ")
    print()
else:
  a=(k-1)//50
  b=k%50
  if b==0:
    for i in range(50):
      print(50+a-i)
      print()
  else:
    for i in range(50):
      b=b-1
      if b>=0:
        print(50+a-i)
      else:
        print(50+a-i-1)
      if i==49:
        print()

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, atan, degrees
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 fractions import gcd
from bisect import bisect
import numpy as np

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

K = INT()
N = 50

ans = np.array(list(range(50)))
ans += K//N
K = K%N

for i in range(K):
	ans[i] += 51
	ans -= 1
print(N)
print(*ans)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, atan, degrees
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 fractions import gcd
from bisect import bisect
import numpy as np

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

K = INT()
N = 50

ans = np.array(list(range(50)))
ans += K//N
K = K%N
for i in range(K):
	ans[i] += 51
	ans -= 1
print(N)
print(*list(ans))

Solution (Python):
k = int(input())
q = (k-1)//50
s = (k-1)%50+1
ans = [0]*50
if k == 0:
    pass
elif k<50:
    for i in range(50):
        if i<s:
            ans[i] = 50
        else:
            ans[i] = 0
else:
    for i in range(50):
        if i<s:
            ans[i] = q+50
        else:
            ans[i] = q+(49-s)
print(50)
print(*ans,sep = " ")

Solution (Python):
k=int(input())
n=50
a=[n-1+k//n]*n
m=k%n
for i in range(m):
  a[i]+=n
  for j in range(n):
    if i==j:continue
    a[j]-=1
print(n)
print(*a)

Solution (Python):
K = int(input())

N = 50
a = [K//N + i for i in range(N)]

for i in range(K % N):
    a[i] += N + 1
for i in range(N):
    a[i] -= K % N
    
print(N)
print(*a)

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

K = INT()

N = 50
d, m = divmod(K, N)

base = N - 1 + d
A = [base] * N

for i in range(m):
    k = A.index(min(A))
    for j in range(N):
        if j == k:
            A[j] += N
        else:
            A[j] -= 1

print(len(A))
print(*A)

Solution (Python):


K = int(input())
N = 50

A = [49] * 50

for i in range(N):
    A[i] += K // 50

for i in range(K % N):
    A[i] += 51
    for j in range(N):
        A[j] -= 1

print(N)
print(*A)

Solution (Python):
import sys

k = int(sys.stdin.readline().rstrip())

def main():
    n = 50
    print(n)
    q, r = divmod(k, n)
    lo = 49 - r + q
    hi = 50 + q

    a = [lo] * (50 - r) + [hi] * r
    return a

if __name__ == '__main__':
    ans = main()
    print(*ans, sep=' ')

Solution (Python):
import sys
import numpy as np

stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split())) 
rs = lambda: stdin.readline().rstrip()  

K = ri()
A = np.ones(50, dtype=np.int64)
A *= 49
x, y = divmod(K, 50)
A += x
A[:y] += 50 - (y-1)
A[y:] -= y
print(50)
print(*A)

Solution (Python):
def d_decrease(SIZE=50):
    K = int(input())

    
    
    q, r = divmod(K, SIZE)
    ans = list(map(lambda x: x + q - r, range(SIZE)))
    for i in range(r):
        ans[i] += SIZE + 1
    return '{}\n{}'.format(SIZE, ' '.join(map(str, ans)))

print(d_decrease())

Solution (Python):
K = int(input())

c, m = divmod(K, 50)
ans = [49+c]*50
for i in range(m):
    for j in range(50):
        if j == i:
            ans[j] += 50
        else:
            ans[j] -= 1

print(50)
print(*ans)

Solution (Python):
K = int(input())
N = 50
X = K//N
Y = K%N
B = N-1+X-Y
print(N)
print(*[B+N+1 if i<Y else B for i in range(N)])

Solution (Python):
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))



K = I()

i,j = divmod(K,50)
a = [100+i-j]*j + [49+i-j]*(50-j)
print(50)
print(*a)

Solution (Python):

def main():
    buf = input()
    k = int(buf)

    n = 50
    a = []
    for i in range(n):
        a.append(n-i-1)
    p = k // 50
    for i in range(n):
        a[i] += p
    k %= 50
    i = 0
    while k > 0:
        a[i] += 1
        k -= 1
        i += 1
    print(n)
    print(' '.join([str(x) for x in a]))

if __name__ == '__main__':
    main()

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    k=int(input())
    p,r=divmod(k,50)
    L=100+p-r
    R=49+p-r
    ans=[L]*r+[R]*(50-r)
    print(50)
    print(*ans)
main()

Solution (Python):
K = int(input())
N = 50
s = N * (N-1) // 2
a = K // N
b = K % N
A = [a + i + (1 if i >= N-b else 0) for i in range(N)]
print(len(A))
print(*A)

Solution (Python):
K = int(input())
N = 50
r = K % N
a = [N - 1 + K // N - r] * N
for i in range(r):
    a[i] += N + 1
print(N)
print(" ".join(map(str, a)))

Solution (Python):
k = int(input())

if k < 50:
    print(2)
    if k % 2 == 0:
        print(str(1 + k // 2) + ' ' + str(1 + k // 2))
    else:
        print(str(k // 2) + ' ' + str(3 + k // 2))
else:
    print(50)
    a = k // 50 + 49
    if k % 50 == 0:
        l = [str(a)] * 50
        print(' '.join(l))
    else:
        alpha = k % 50
        l = [str(a + 51 - alpha)] * alpha + [str(a - alpha)] * (50 - alpha)
        print(' '.join(l))

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    k=int(input())
    n=50
    q=k//n
    r=k%n
    A=[q+n-r+1+i for i in range(r)]+[q+i for i in range(n-r)]
    print(n)
    print(*A)
resolve()

Solution (Python):
def main():
    k=int(input())
    n=50
    a=k%n
    w=k//n
    if k==0:
        print(2)
        print(1,1)
        return 0
    elif k==1:
        print(2)
        print(2,0)
        return 0
    elif k<n:
        print(k)
        print(*[k]*k)
        return 0
    print(n)
    p=[w+n-1]*n
    for i in range(a):
        p[i]=p[i]+n-a+1
    for i in range(a,n):
        p[i]-=a
    print(*p)
main()

Solution (Python):
K = int(input())

N = 50
q = K//N
r = K%N

ans = [q+i for i in range(N)]

for i in range(r):
    ans[i] += N
    for j in range(i+1, N):
        ans[j] -= 1
        
for i in range(N):
    ans[i] = str(ans[i])
    
print(N)
print(" ".join(ans))

Solution (Python):
k = int(input())

q, mod = divmod(k, 50)
l = [50 if mod > 0 and i == (50-mod) else i for i in range(50)]

result = [str(q+l[i]) for i in range(50)]
print(50)
print(" ".join(result))

Solution (Python):
def examD():
    K = I()
    N = 50
    A = [i for i in range(N)]
    for i in range(N):
        A[-1-i] +=((K-i+49)//N)
    print(N); print(" ".join(map(str,A)))

import sys
import copy
import bisect
import heapq
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examD()

Solution (Python):
def examD():
    K = I()
    N = 50
    A = [i for i in range(N)]
    for i in range(N):
        A[-1-i] +=((K-i+49)//N)
    print(N); print(" ".join(map(str,A)))

import sys
import copy
import bisect
import heapq
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examD()

Solution (Python):
k = int(input())
n = 50
d = k%n

a = [49]*n

for i in range(d):
    for j in range(n):
        a[j] -= 1
    a[i] += (n+1)

for j in range(n):
    a[j] += k//n
print(n)
print(*a)

Solution (Python):
import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')

K = I()
ans = int(50)
ansC = [0]*50
for i in range(50):
    ansC[i] = ((K+i)//50)+i

"""
ansC[0] +=(K+1)
ansC[0] -= (K // 2)
ansC[1] += (K // 2)
"""
print(ans)
print(" ".join(map(str,ansC)))

Solution (Python):
k=int(input())
a=[]
print(50)
n=k%50
m=k//50
for i in range(n):
    a.append(100+m-n)
for i in range(50-n):
    a.append(49+m-n)
print(*a)

Solution (Python):
K = int(input())

N = 50
q = K // N
r = K % N

a = (N - 1 + q) + N - (r - 1)
b = (N - 1 + q) - r

answer = [a] * r + [b] * (N - r)
print(N)
print(' '.join(list(map(str, answer))))

Solution (Python):


def solve(k, n):
    q, r = divmod(k, n)
    a = list(range(q, n + q))

    max_ = n + q - 1
    for i in range(r):
        a[i] += n
        for j in range(n):
            if i == j:
                continue
            a[j] -= 1
            if a[j] < 0:
                return []

        if a[i] < max_:
            return []
        else:
            max_ = a[i]
    return a


if __name__ == '__main__':
    k = int(input())
    for n in range(2, 50 + 1):
        a = solve(k, n)
        if all(map(lambda x: x <= 10 ** 16 + 1000, a)):
            print(n)
            print(*a)
            break

"""
2≦N≦50,0≦ai≦10**16+1000でなければならないのでダメ。

k:偶数
(x+1,x) -> (x,x-1) 操作2回
-> (1,0)
k:奇数
(x+2,x) -> (x+1,x-1) 操作2回
-> (2,0) -> (0,1)
全体を2減らすのに操作2回
k=2より最終値は0/1なので、
偶数なら(2x+1)-1=2x=k
奇数なら(2x+2)-2+1=2x+1=k
したがって、x=k//2

n = 2
x = k // 2
a = (x, x + (1 if k % 2 == 0 else 2))
print(n)
print(*a)
"""

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
if 50 >= N > 1:
  print(N)
  res = [N] * N
  print(*res)
elif N > 50:
  print(50)
  res = [49] * 50
  t = N // 50
  for i in range(50):
    res[i] += t
  u = N % 50
  if u:
    for i in range(u):
      res[i] += 50 - u + 1
    for i in range(u, 50):
      res[i] -= u
  print(*res)
elif N == 0:
  print(2)
  print(1, 1)
elif N == 1:
  print(2)
  print(2, 0)

Solution (Python):
K = int(input())
N = 50
a = [K//N + N-1]*50

for i in range(K%N):
    a[i] += N+1
    for j in range(N):
        a[j] -= 1

print(N)
for i in a:
    print(i,end=" ")
print()

Solution (Python):




 
from collections import* 
from fractions import gcd
from functools import* 
from itertools import* 
from operator import mul,itemgetter
from bisect import* 
from heapq import* 
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)

 
def main():
    k=int(input())
    ans=list(range(1,51))
    ans[49-k%50]-=1
    for i in range(50):
        ans[i]+=(k//50)
    
    print(50)
    print(*ans)
if __name__ == '__main__':
    main()

Solution (Python):

def main():
    K = int(input())
    N, A, r = 50, [49 + K // 50] * 50, K % 50
    for i in range(N):
        A[i] += N - r + 1 if i < r else -r
    print(N)
    print(*A)


if __name__ == "__main__":
    main()

Solution (Python):
N = 50
K = int(input())
x = K%N
ls = [0]
for i in range(N-1):
  ls += [ls[-1]+1]
for i in range(x):
  ls[i] += N
  for j in range(N):
    if j!=i:
      ls[j] -= 1
ans = [(K-x)//N+c for c in ls]
print(N)
print(*ans)

Solution (Python):
import heapq

k = int(input())
n = 50
div = k//50
mod = k%50

ans = [div+n-1 for i in range(n)]
heapq.heapify(ans)

for i in range(mod):
    Min = heapq.heappop(ans)
    for j in range(n-1):
        ans[j] -= 1
    heapq.heappush(ans,Min+50)

print(n)
print(*ans)

Solution (Python):
K = int(eval(input()))




N = 50
r = K % N
q = K // N
A = []
for i in range(N):
  A.append(N-1 + q + (i<r)*(N-r+1) - (i>=r)*r)
print(N)
print(*A)

Solution (Python):
import sys
import heapq
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

K = I()

q = K//50
p = K%50

ans = [i+q for i in range(50)]
left = 50-p
for i in range(left,50):
  ans[i] += 1

print(50)
print(" ".join(map(str, ans)))

Solution (Python):
K = int(input())
N = 50
r = K % N
a = [N - 1 + K // N - r] * N
for i in range(r):
    a[i] += N + 1
print(N)
print(" ".join(map(str, a)))

Solution (Python):
k=int(input());print(50,*[k//50+i+(i+k%50>49)for i in range(50)])

Solution (Python):
k=int(input())
a,b=k//50,k%50
if b==0:b==50
l=[a+i+(i>=50-b) for i in range(50)]
print(50)
print(*l)

Solution (Python):
N=int(input())

if N<=50:
    A=[0 for i in range(50)]
    for i in range(N):
        A[i]=50
    print(50)
    print(*A)
else:
    A=[50-i for i in range(50)]
    N-=50
    for i in range(50):
        A[i]+=N//50
    for i in range(N%50):
        A[i]+=1
    print(50)
    print(*A)

Solution (Python):
K = int(input())

A = [49] * 50
q, r = divmod(K, 50)
for i in range(50):
    A[i] += q
for i in range(r):
    for j in range(50):
        if i == j:
            A[j] += 50
        else:
            A[j] -= 1

print(50)
print(*A)

Solution (Python):
K = int(input())

lis = [49] * 50

dif = K // 50
amari = K % 50

for i in range(50):

    lis[i] += dif

    if i < amari:
        lis[i] += 50 - amari + 1
    else:
        lis[i] -= amari

print (50)

print (" ".join(map(str,lis)))

Solution (Python):
k = int(input())
n= 50
lastli = list(range(n))

syo = k//n
amari = k%n

for i in range(len(lastli)):
    lastli[i] += syo

for i in range(amari):
    lastli[i] += n
    for j in range(n):
        if j == i:
            continue
        else:
            lastli[j] -= 1

print(n)
print(*lastli)

Solution (Python):
k,s=divmod(int(input()),50);d=50-s;print(50,*[50+k]*s+[d+k-1]*d)

Solution (Python):
k=int(input())
n=50
a=[n-1+k//n]*n
for i in range(k%n):
  a[i]+=n
  for j in range(n):
    if i!=j:a[j]-=1
print(n)
print(*a)

Solution (Python):
k=int(input())
n=50
a=[n-1+k//n]*n
for i in range(k%n):
  a[i]+=n
  for j in range(n):
    if i!=j:a[j]-=1
print(n)
print(*a)