not quite right! fails case 4 in sample.in
fix at last
solve sample
important comment
easy debug