1819The Twin Towers

1819   The Twin Towers

题目描述

Twin towers we see you standing tall, though a building's lost our faith will never fall.
Twin towers the world hears your call, though you're gone it only strengthens our resolve.
We couldn't make it through this without you Lord, through hard times we come together more. ...

Twin Towers - A Song for America

In memory of the tragic events that unfolded on the morning of September 11, 2001, five-year-old Rosie decids to rebuild a tallest Twin Towers by using the crystals her brother has collected for years. Will she succeed in building the two towers of the same height?

输入格式:

There are mutiple test cases.

One line forms a test case. The first integer N (N < 100) tells you the number of crystals her brother has collected. Then each of the next N integers describs the height of a certain crystal.

A negtive N indicats the end.

Note that all crytals are in cube shape. And the total height of crystals is smaller than 2000.

输出格式:

If it is impossible, you would say "Sorry", otherwise tell her the height of the Twin Towers.

输入样例 复制
4 11 11 11 11
4 1 11 111 1111 
-1
输出样例 复制
22
Sorry

说明

7
11
通过提交
时空限制2000ms/64mb
题目来源
评测方式在线评测
题目类型基础强化
难        度