UVA11026 A Grouping Problem

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=22&page=show_problem&problem=1967 [PDF](https://uva.onlinejudge.org/external/110/p11026.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11026/b9a172fe5aa995f07327392054077b990cd03213.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11026/1886ac6ad7322c7eee48061d9f89dc108fa5f247.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11026/1873fcda458d342f788adceb317954315345af9a.png)