Problem1038--卡片选择1038: 卡片选择
Time Limit: 1 Sec Memory Limit: 128 MB
Submit: 5805 Solved: 2847
[Submit] [Status] [Web Board] [Creator:]Description
穗乃果有 n 张卡片,每张卡片上要么是 0,要么是 5 ,穗乃果能从其中选出若干卡片然后组成一些数字,你能找出所有可能的数字中能整除 90 的最大数字吗?若不存在,请输出 -1 。
Input
第一行包含一个正整数n(1<=n<=103)。
接下来一行包括n个正整数ai(ai=0, 5).
Output
Sample Input
11
5 5 5 5 5 5 5 5 0 5 5
Sample Output
5555555550
Source/Category
[Submit] [Status]