-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapples_oranges.py
More file actions
56 lines (38 loc) · 1.15 KB
/
Copy pathapples_oranges.py
File metadata and controls
56 lines (38 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import math
import os
import random
import re
import sys
def countApplesAndOranges(s, t, a, b, apples, oranges):
# Write your code here
apple = 0
orange = 0
apples_dis = []
oranges_dis = []
for i in apples:
i += a
apples_dis.append(i)
for i in oranges:
i += b
oranges_dis.append(i)
for app in apples_dis:
if app >= s and app <= t:
apple+=1
print(apple)
for ora in oranges_dis:
if ora >= s and ora <= t:
orange+=1
print(orange)
if __name__ == '__main__':
first_multiple_input = input().rstrip().split()
s = int(first_multiple_input[0])
t = int(first_multiple_input[1])
second_multiple_input = input().rstrip().split()
a = int(second_multiple_input[0])
b = int(second_multiple_input[1])
third_multiple_input = input().rstrip().split()
m = int(third_multiple_input[0])
n = int(third_multiple_input[1])
apples = list(map(int, input().rstrip().split()))
oranges = list(map(int, input().rstrip().split()))
countApplesAndOranges(s, t, a, b, apples, oranges)