Problem:


Score : 100 points

Problem Statement

We have three boxes A, B, and C, each of which contains an integer.

Currently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.

We will now do the operations below in order. Find the content of each box afterward.  

Swap the contents of the boxes A and B

Swap the contents of the boxes A and C

Constraints

1 \leq X,Y,Z \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

X Y Z

Output

Print the integers contained in the boxes A, B, and C, in this order, with space in between.

Sample Input 1

1 2 3

Sample Output 1

3 1 2

After the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.

Then, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.  

Sample Input 2

100 100 100

Sample Output 2

100 100 100

Sample Input 3

41 59 31

Sample Output 3

31 41 59



Sample input:
1 2 3


Sample output:
3 1 2

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a, b, c = map(int, input().split())
a, b = b, a
a, c = c, a
print(a, b, c)

Submission status: Accepted

Solution code:
X, Y, z = map(int, input().split())
print(z,X,Y)

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from bisect import bisect_right, bisect_left
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, gamma, log
from operator import mul
from functools import reduce
from copy import deepcopy

sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7


x, y, z = LI()
x, y = y, x
x, z = z, x
print(x, y, z)

Submission status: Accepted

Solution code:
[x,y,z] = [int(i) for i in input().split()]
print(z,x,y)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


def solve(X: int, Y: int, Z: int):
    print(Z, X, Y)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    Y = int(next(tokens))  # type: int
    Z = int(next(tokens))  # type: int
    solve(X, Y, Z)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    X, Y, Z = [int(x) for x in input().split()]

    print(Z, X, Y)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin
from sys import setrecursionlimit
from collections import Counter, deque, defaultdict
setrecursionlimit(1000000)

# INF = float('inf')
INF = int(1e10)

def input():
    return stdin.readline()[:-1]

def main():
    from builtins import int, map
    X, Y, Z = map(int, input().split())
    print(Z, X, Y)

if __name__ == '__main__':
    main()

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value

x, y, z = mi()

print(z, x, y)

Submission status: Accepted

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


main()

Submission status: Accepted

Solution code:
X, Y, Z = [int(i) for i in input().split()]
print(Z,X,Y)

Submission status: Accepted

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
x,y,z=map(int,input().split())
print(z,x,y)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def isOK(A):
    A.sort()
    for i in range(len(A) - 1):
        if A[i] + 1 != A[i + 1]:
            return False
    return True


def solve():
    A, B, C = Scanner.map_int()
    A, B = B, A
    A, C = C, A
    print(A, B, C, sep=' ')


def main():
    # sys.stdin = open("sample.txt")
    solve()


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    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): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

x,y,z = m()

print(z,x,y)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#template
from collections import Counter
def inputlist(): return [int(k) for k in input().split()]
#template
X,Y,Z = inputlist()
print(Z,X,Y)

Submission status: Accepted

Solution code:
# ABC161a


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    # 再帰関数を使わない限りPypyで出すこと

    def dump(*args):
        sys.stderr.write(str(args))

    x, y, z = map(int, input().split())
    print(z, x, y)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    x,y,z = LI()
    print(z,x,y)
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    X,Y,Z=map(int,input().split())
    print(Z,X,Y)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

x, y, z = map(int, readline().split())
print(z, x, y)

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
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
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]

x, y, z = MAP()
print(z, x, y)

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    A,B,C=MI()
    print(C,A,B)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x, y, z = [int(i) for i in input().split()]
print(z,x,y)

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

A, B, C = list(map(int, sys.stdin.buffer.readline().split()))
A, B = B, A
A, C = C, A
print(A, B, C)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

x, y, z = na()
print(z, x, y)

Submission status: Accepted

Solution code:

A, B, C = map(int, input().split())

print(C,A,B)

Submission status: Accepted

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

Submission status: Runtime Error

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

A = Y
B = X
A = Z
C = X

print(str(A)+' '+str(B)+' '+str(C))

Submission status: Runtime Error

Solution code:
[A, B, C] = list(map(int, input().split(' ')))

print(C + ' ' + A + ' ' + B)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

a = z

z = y
y = x
x = a

print(x y z)

Submission status: Runtime Error

Solution code:
X, Y, Z = input()
print(Z, X, Y)

Submission status: Runtime Error

Solution code:
N,K = map(int, input().split())

N = N%K
while(abs(N-K) < N):
  N = abs(N-K)
  
print(N)

Submission status: Runtime Error

Solution code:
X,Y,Z=map(int,input())
print(str(Z)+' '+str(X)+' '+str(Y))

Submission status: Runtime Error

Solution code:
X, Y, Z = map(int, input().split())
print(Z X Y)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# スペース区切りの整数の入力
b, c = map(int, input().split())
# 文字列の入力
s = input()
# 出力
# print("{} {}".format(a+b+c, s))
print(f'{a+b+c} {s}')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
ar = list(map(int, input().split()))

add = sum(ar)
check = add / (4 * m)
amt = 0

for num in ar:
    if num > check:
        amt += 1

if amt >= m:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip.split())
def main():
    x,y,x = LI()
    print(z,x,y)
main()

Submission status: Runtime Error

Solution code:
X, Y, Z = map(int, input())
print(Z, X, Y)

Submission status: Runtime Error

Solution code:
a = map(int,input().split())
a[0],a[1] = a[1],a[0]
a[0],a[2] = a[2],a[0]
print(str(a))

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split(" "))
if abs(N)%K==0:
  print(1)
else:
  M=abs(N)%K
  S=abs(M-K)
print(min(M,S))

Submission status: Runtime Error

Solution code:
count = 0
n, m = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n):
    if a[i] >= sum(a)/4/m:
        count += 1
if count >= m:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
x,y,z =map(int,input().splilt())
t=0
t=x;x=y;y=t;
t=x;x=z;z=t;
print(x,y,z)

Submission status: Runtime Error

Solution code:
X, Y, Z = input().split(' ')
print([Z, X, Y].join(' '))

Submission status: Runtime Error

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

A, B = B, A
A, C = C, A
print(A, B, C)A, B, C = list(map(int, input().split()))

A, B = B, A
A, C = C, A
print(A, B, C)

Submission status: Runtime Error

Solution code:
X, Y, Z = in(input())
print(Z, X, Y)

Submission status: Runtime Error

Solution code:
X, Y, Z = input()
print(Z X Y)

Submission status: Runtime Error

Solution code:
X, Y, Z = input()
print(Z)
print(X)
print(Y)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
num=input().split()
print(num[2,num[0],num[1])

Submission status: Runtime Error

Solution code:
x=input()
y=input()
z=input()

print(z,x,y)

Submission status: Runtime Error

Solution code:
N, K = input().split(' ')
N0 = int(N)
K = int(K)
N1 = abs(N0-K)
while N1 < N0:
  N0 = N1
  N1 = abs(N1-K)
else:
  print(N0)

Submission status: Runtime Error

Solution code:
import numpy as np

# Nこの商品の中からM個選ぶ
N, M = list(map(int, input().split()))
# 商品iの得票数はA_i
A = list(map(int, input().split()))

A = np.array(A)
A = np.sort(A)[::-1]

flag = True

if A[M-1] >= 1/(4*M):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
import collections
import collections, heapq, itertools, bisect
import math, fractions
import sys, copy
from sortedcontainers import SortedSet

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline().strip())
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline().strip())
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007

def main():
    s = S()
    print(s)
    

main()

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
A=list(map(int,input().split()))
s=sorted(A,reverse=True)[m-1]
t=sum(A)//(4*m)+1
if s>=t:
    ans='Yes'
else:
    ans='No'
print(ans)

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=sum(a)
c=sorted(a)
if c[n-m] >=b//(4*m):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

temp2=z
z=x
x=temp2
print(x,y,z)

Submission status: Runtime Error

Solution code:
a = input().split()
print(a[3] +' ' +a[1]+' ' + a[2])

Submission status: Runtime Error

Solution code:
x, y, z = list(map(int, input()))
x, y = y, x
x, z = z, x
print(x, y, z)

Submission status: Runtime Error

Solution code:
n = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
count = 0
for i in a:
	if(i * 4 * n[1] >= n[0]):
		count += 1
if(count >= n[1]):
	print('Yes')
else:
	print('No')

Submission status: Runtime Error

Solution code:
X=int(input())
Y=int(input())
Z=int(input())
print(Z, X, Y)

Submission status: Runtime Error

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

print(b,a)

Submission status: Runtime Error

Solution code:
x = map(int, input().split())
print(x[2],x[0],x[1])

Submission status: Runtime Error

Solution code:
import numpy as np
import pandas as pd

X, Y, Z = map(int, input().split())
print(Z, X, Y)

Submission status: Runtime Error

Solution code:
import numpy as np
import pandas as pd

X, Y, Z = map(int, input().split())
print(Z, X, Y)

Submission status: Runtime Error

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

a = b, b = a
a = c, c = a
print(a b c)

Submission status: Runtime Error

Solution code:
#

import sys
input=sys.stdin.readline

def main():
    x,y,z=map(int.input().split())
    print(z,x,y)
    
    
    
if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
X,Y,Z = map(int,input().sp;split())
print(Z,X,Y)

Submission status: Runtime Error

Solution code:
import sys
readline = sys.stdin.readline()
A,B,C = map(int,readline().split())
print(C,A,B)

Submission status: Runtime Error

Solution code:
import sys
readllne = sys.stdin.readllne
A,B,C = map(int,readllne().split())
print(C,A,B)

Submission status: Runtime Error

Solution code:
import sys
readllne = sys.stdin.readllne()
A,B,C = map(int,readllne().split())
print(C,A,B)

Submission status: Runtime Error

Solution code:
X,Y,Z = int(input().split())
print('{} {} {}'.format(Z,X,Y))

Submission status: Runtime Error

Solution code:
k = int(input())

n = 1
cnt = 0
while True:
    s = str(n)
    for i in range(len(s) - 1):
        if not int(s[i + 1]) in [int(s[i]), int(s[i]) - 1, int(s[i]) + 1]:
            break
    else:
        cnt += 1
    if cnt == k:
        break
    n += 1

print(n)

Submission status: Runtime Error

Solution code:
N=int(input())
import math
a=0
for i in range(1,int(math.sqrt(N-1))+1):
  if (N-1)%i==0:
    a+=2
    i+=1
  else:
    i+=1
a-=1

if int(math.sqrt(N-1))==math.sqrt(N-1):
  a-=1
for i in range(2,int(math.sqrt(N))+1):
  if N%i==0:
    t=N
    while t%i==0:
      t=t/i
    if t%i==1:
      a+=1
      i+=1
    else:
      i+=1
a+=1
print(a)

Submission status: Runtime Error

Solution code:
 = list(map(int,input().split()))
m = []
for i in range(2):
    m.append(n[i])
    n.pop(i)
    n.append(m[i])
  
for i in range(3):
  print(str(n[i]) + ' ',end='')

Submission status: Runtime Error

Solution code:
n = [map(int,input().split())]
for i in range(2):
  n.pop(i)
  n.append(n[i])
  
for i in range(3):
  print(n[i],end='')

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = list(map, input().split())
A.sort(reverse=True)
S = sum(A)
if A[M-1] >= S/ (4*M): print("Yes")
else: print("No")

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = list(map, input().split())
A.sort(reverse=True)
S = sum(A)
if A[M-1] >=S/ (4*M):
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
from collections import deque

k = int(input())
q = deque(range(1, 10))

for i in range(k-1):
    # popをk-1回やる
    x = q.popleft()
    y = int(str(x)[-1])
    if y-1 >= 0:
        print(int(str(x)+str(y-1)))
        q.append(int(str(x)+str(y-1)))
    q.append(int(str(x)+str(x)[-1]))
    if y+1 < 10:
        q.append(int(str(x)+str(y+1)))

print(q[0])

Submission status: Runtime Error

Solution code:
import math
n, k = map(int, input().split())
x = math.ceil( n/k )
if abs(n - k*x) < n:
    n = abs(n - k*x)
print(n)

Submission status: Runtime Error

Solution code:
import os
import heapq
import sys
import math
from collections import defaultdict
from io import BytesIO, IOBase
def check_kth_power(n, k):
        while n%k == 0:
            n = n/k

        if n != 1:
            return False
        return True
def main():
    #for _ in range(int(input())):
    n,m=map(int,input().split())
    arr=[int(k) for k in input().split()]
    
    total=0
    for i in range(n):
        total+=arr[i]
    val=(total/(4*m))
    counter=0
    #print(val)
    ans="No"
    for i in range(n):
        if arr[i]>=val:
            counter+=1
        if counter==m:
            ans="Yes"
    print(ans)
        
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
# N：全種類数、M：今回種類数
N,M = map(int, input().split())
# 得票数
hyou = list(map(int, input().split()))

# 総得票数
total_hyou = sum(hyou)

# 得票数基準クリア数
count = 0
border = int(total_hyou/(4*M))
for j in hyou:
  if j >= border:
    count += 1
    
# 人気商品をM個選べるかどうか
if count >= M:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
# N：全種類数、M：今回種類数
N,M = map(int, input().split())
# 得票数
hyou = list(map(int, input().split()))

# 総得票数
total_hyou = 0
for i in hyou:
  total_hyou += i

# 得票数基準クリア数
count = 0
border = int(total_hyou/(4*M))
for j in hyou:
  if j >= border:
    count += 1
    
# 人気商品をM個選べるかどうか
if count >= M:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
# N：全種類数、M：今回種類数
N,M = map(int, input().split())
# 得票数
hyou = list(map(int, input().split()))

# 総得票数
total_hyou = 0
for i in hyou:
  total_hyou += i

# 得票数基準クリア数
count = 0
border = int(total_hyou*(1/4*M))
for j in hyou:
  if j >= border:
    count += 1
    
# 人気商品をM個選べるかどうか
if count >= M:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
# N：全種類数、M：今回種類数
N,M = map(int, input().split())
# 得票数
hyou = list(map(int, input().split()))

# 総得票数
total_hyou = 0
for i in hyou:
  total_hyou += i

# 得票数基準クリア数
count = 0
for j in hyou:
  if j >= 1/4*M:
    count += 1
    
# 人気商品をM個選べるかどうか
if count >= M:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
# N：全種類数、M：今回種類数
N,M = map(int, input().split())
# 得票数
hyou = list(map(int, input().split()))

# 総得票数
total_hyou = 0
for i in hyou:
  total_hyou += i

# 得票数基準クリア数
count = 0
for i in hyou:
  if i >= 1/4*M:
    count += 1
    
# 人気商品をM個選べるかどうか
if count >= M:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())

x = [n-k*i for i in range(n//k+2)]
x[-1] = abs(x[-1])
print(min(x))

Submission status: Runtime Error

Solution code:
n,k = map(int, input().split())
def sa(x):
    if x < 0:
        return abs(x)
    return abs(sa(x-k)-k)
print(sa(n))

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    n, m = map(int, input().split())
    a = [int(i) for i in input().split()]
    s = sum(a)
    a = sorted(a)[::-1]
    if a[m-1] >= (s / (4 * m)):
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
import sys


if __name__ == '__main__':
    print(f"{sys.argv[-1]} {sys.argv[1]} {sys.argv[2]}")

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
m = n//k
a = n - (k*m)
    
print(min(a,abs(a-k)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input() b = input() c = input()
a,b,c = c,a,b
print(a b c)

Submission status: Runtime Error

Solution code:
x,y,z=map(int,input().split())
li=[z,x,y]
print(" ".join(li))

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))
total = sum(A) / 4 * M
A.sort(reverse = True)
if A[M-1] >= total:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
if n<k:
    print(n)
elif n==k:
    print('0')
else:
    a=n-k*(n//k)
    print(min(a,abs(a-k)))

Submission status: Runtime Error

Solution code:
a,b,c = map(string,input().split())
print(c+' '+a+' '+b)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print ((C,A,B).split())

Submission status: Runtime Error

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

print ((C,A,B).split=())

Submission status: Runtime Error

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

print (int(C,A,B).split=())

Submission status: Runtime Error

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

print (int(C,A,B).split)

Submission status: Runtime Error

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

print (map(int(C,A,B).split))

Submission status: Runtime Error

Solution code:
N=int(input())

A=N[0]
B=N[1]
C=N[2]

print (C,A,B)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

X,Y,Z = map(int, readline())

A,B,C = Z,X,Y

print(A,B,C)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

d = a
a = b
b = d 
d = c 
c = a
a = d
print(a,b,c)

Submission status: Runtime Error

Solution code:
n,p = map(int,input().split(" "))
 
l = input().split(" ")
s = 0
for  i in l:
  m = int(i)
  s = s + m
 
t = m/4/p
 
c = 0
for i in l:
  m = int(i)
  if m > t:
    c = c + 1
if c >= p:
  print("Yes")
else:
  print("No")