BlackrockOA #1
Road Trip (Analyst Program :P
简单可在线判题
Given the distance from the start of each city's gas station along a straight route, output the distance from the start to the first station and then between each pair of subsequent adjacent stations.
输入格式
One line containing 1..5000 items of the form city name, distance, separated by semicolons, possibly with a trailing semicolon. City names are non-empty and contain no commas or semicolons; distances are integers in 0..1000000000.
输出格式
After sorting by distance from the start in ascending order, output the distance from the start to the first station and the distances between adjacent stations, separated by an ASCII comma and a space; stations at the same position are 0 apart.
样例 1
输入:
Rkbs, 5453; Wdqiz, 1245; Rwds, 3890; Ujma, 5589; Tbzmo, 1303;
输出:
1245, 58, 2587, 1563, 136
样例 2
输入:
Near, 0;
输出:
0
样例 3
输入:
Far, 1000000000; Other, 1000000000; Middle, 500000000;
输出:
500000000, 500000000, 0