fork download
  1. # your code goes here
  2. n = []
  3. index_ = []
  4. result = 0
  5. for _ in range(8):
  6. n.append(int(input()))
  7. for _ in range(5):
  8. result += max(n)
  9. index_.append(n.index(max(n))+1)
  10. a = n.index(max(n))
  11. n[a] = 0
  12. index_.sort()
  13. print(result)
  14. print(*index_)
  15.  
Success #stdin #stdout 0.03s 9664KB
stdin
20
30
50
48
33
66
0
64
stdout
261
3 4 5 6 8