import Foundation var i = 0 var N = 0 var m = 0 var masterArr = [(sn:Int, price:Int, manyi:Int)]() var dict = [Int : [(price:Int, manyi:Int)]]() while let line = readLine() { let parts = line.split(separator: " ") if (parts[0] == "***") { break } if (i == 0) { N = In...