Practice 1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

CARS AND BIKES

x=(int(input()))
lst = []
for i in range(0, x):
ele = int(input())
lst.append(ele)
for i in range(0, x):
if(lst[i]%4==0):
print("NO")
elif(lst[i]%2==0):
print("YES")
x-=1

PRIMARILITY TEST

t = int(input())
for i in range(t):
n = int(input())
c=0
for i in range(1,n+1):
if n%i==0:
c+= 1
if c==2:
print('yes')
else:
print('no')

DEGREE OF POLYNOMIAL

t = int(input())
while(t):
t -= 1
n = int(input())
li = list(map(int,input().split()))
li.reverse()
for i in range(len(li)):
if li[i] != 0:
print(n-i-1)
break
else:
pass

CIRCULAR TRACK

# cook your dish here


for _ in range(int(input())):
a,b,m=map(int,input().split())
if(abs(a-b)<=m//2):
print(abs(a-b))
else:
print(m-max(a,b)+min(a,b))

MUTATED MINIONS

for i in range(int(input())):
n,k = map(int, input().split());
dnas = [int(d)+k for d in input().split()];
count = 0
for j in dnas:
if j%7 == 0:
count +=1;
print(count);

You might also like