fork download
  1. w=lambda p:any([1for i in 0,1for e in p[i]if g[i^1]<e<g[i]]for g in[[sum(l)*1./len(l)for l in p]])
  2.  
  3. if __name__=="__main__":
  4. import sys
  5. for e in [ip.strip().split(",") for ip in sys.stdin if ip.strip() != ""]:
  6. print str(e)
  7. print w([map(int,e[0].split(" "))]+[map(int, e[1].split(" "))])
  8.  
Success #stdin #stdout 0.01s 7740KB
stdin
1,2 3
1 2 3,4 5 6
3 4 5 6,2 3 4 5
6 5 9 5 6 0,6 2 0 9 5 2
0 4,9 1 0 2 8 0 5 5 4 9
1,2
2 4,5
1 5,2 3 4 5
2 1 2 3 1 3,5 1 6
4 4 5 2 4 0,9 2 10 1 9 0
stdout
['1', '2 3']
True
['1 2 3', '4 5 6']
True
['3 4 5 6', '2 3 4 5']
True
['6 5 9 5 6 0', '6 2 0 9 5 2']
True
['0 4', '9 1 0 2 8 0 5 5 4 9']
True
['1', '2']
False
['2 4', '5']
False
['1 5', '2 3 4 5']
False
['2 1 2 3 1 3', '5 1 6']
False
['4 4 5 2 4 0', '9 2 10 1 9 0']
False