시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 3121 1198 1092 40.015%

문제

슈퍼 마리오 앞에 10개의 버섯이 일렬로 놓여져 있다. 이 버섯을 먹으면 점수를 받는다.

슈퍼 마리오는 버섯을 처음부터 나온 순서대로 집으려고 한다. 하지만, 모든 버섯을 집을 필요는 없고 중간에 중단할 수 있다.

중간에 버섯을 먹는 것을 중단했다면, 그 이후에 나온 버섯은 모두 먹을 수 없다. 따라서 첫 버섯을 먹지 않았다면, 그 이후 버섯도 모두 먹을 수 없다.

마리오는 받은 점수의 합을 최대한 100에 가깝게 만드려고 한다.

버섯의 점수가 주어졌을 때, 마리오가 받는 점수를 출력하는 프로그램을 작성하시오.

입력

총 10개의 줄에 각각의 버섯의 점수가 주어진다. 이 값은 100보다 작거나 같은 양의 정수이다. 버섯이 나온 순서대로 점수가 주어진다.

출력

첫째 줄에 마리오가 받는 점수를 출력한다. 만약 100에 가까운 수가 2개라면 (예: 98, 102) 마리오는 큰 값을 선택한다.

예제 입력 1

10
20
30
40
50
60
70
80
90
100

예제 출력 1

100
W3sicHJvYmxlbV9pZCI6IjI4NTEiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMyODhcdWQzN2MgXHViOWM4XHViOWFjXHVjNjI0IiwiZGVzY3JpcHRpb24iOiI8cD5cclxuXHRcdWMyODhcdWQzN2MgXHViOWM4XHViOWFjXHVjNjI0IFx1YzU1ZVx1YzVkMCAxMFx1YWMxY1x1Yzc1OCBcdWJjODRcdWMxMmZcdWM3NzQgXHVjNzdjXHViODJjXHViODVjIFx1YjE5M1x1YzVlY1x1YzgzOCBcdWM3ODhcdWIyZTQuIFx1Yzc3NCBcdWJjODRcdWMxMmZcdWM3NDQgXHViYTM5XHVjNzNjXHViYTc0IFx1YzgxMFx1YzIxOFx1Yjk3YyBcdWJjMWJcdWIyOTRcdWIyZTQuPFwvcD5cclxuXHJcbjxwPlxyXG5cdFx1YzI4OFx1ZDM3YyBcd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