Skip to content

Instantly share code, notes, and snippets.

@SahilKadam
Created October 13, 2016 04:25
Show Gist options
  • Save SahilKadam/2ead07d7a310c0d4024dd8db34f9dd01 to your computer and use it in GitHub Desktop.
Save SahilKadam/2ead07d7a310c0d4024dd8db34f9dd01 to your computer and use it in GitHub Desktop.
Input Format The first line contains two space-separated integers denoting the respective values of and . The second line contains two space-separated integers denoting the respective values of and . The third line contains two space-separated integers denoting the respective values of and . The fourth line contains space-separated integers deno…
#!/bin/python3
import sys
s,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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment