Math, asked by kimpal6389, 1 year ago

Input format the first line contains two space-separated integers n and d. the next n lines contain one integer each, the ith line giving the value of l[i]. assume that the maximum value of n is 50. output format output a single line containing the maximum number of pairs of swords that can be formed.

Answers

Answered by AnmolRaii
1

Input Format

The first line contains two space-separated integers denoting the respective values of n (the number of integers) and d (the number of left rotations you must perform

,t = input().strip().split(' ')

s,t = [int(s),int(t)]

a,b = input().strip().split(' ')

a,b = [int(a),int(b)]

m,n = input().strip().split(' ')

m,n = [int(m),int(n)]

apple = [int(apple_temp) for apple_temp in input().strip().split(' ')]

orange = [int(orange_temp) for orange_temp in input().strip().split(' ')]

apple_on_house = [item for item in apple if a+item >= s and a+item <=t]

orange_on_house = [item for item in orange if b-item <= t and b-item >= s]

print (len(apple_on_house))

print (len(orange_on_house))

Similar questions