-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathproblem3.py
More file actions
33 lines (27 loc) · 709 Bytes
/
problem3.py
File metadata and controls
33 lines (27 loc) · 709 Bytes
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
import math
def calcoptimise(univs,x,y):
# print(univs,x,y)
dist=0
for index in range(len(univs)):
univs[index]
return dist
def main():
line = raw_input()
[n,q] = line.split(' ')
if(math.isnan(int(n)) or math.isnan(int(q))):
return
line = raw_input()
univs = line.split(' ')
if not(len(univs)==int(n)):
return
inputindex = 0
while inputindex < int(q):
line = raw_input()
[x,y] = line.split(' ')
if(math.isnan(int(x)) or math.isnan(int(y))):
return
print(calcoptimise([int(item) for item in univs],int(x),int(y)))
inputindex+=1
return
if __name__ == "__main__":
main()