Logo
(追記) (追記ここまで)

31022번 - Corrupted Gradebook 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB61221747.222%

문제

A gradebook has been corrupted so that the columns have been removed. Each student's record simply contains a single string of digits. Knowing that the string of digits must have come from G different assignments (each with a possible integer grade between 0 and 100, inclusive), parse the string so that the average of the G grades is maximized. No grade other than 0 will start with the digit 0 (i.e. there are no leading zeros in any grade). Print out the average for the given grades, rounded to the nearest integer.

입력

The first line of input contains the number of test cases, C (1 ≤ C ≤ 100). Each of the following C lines contains an integer G (1 ≤ G ≤ 25) indicating the number of grades, followed by a string of digits containing the corrupted grades.

출력

For each test case, output a single line containing the maximum average grade possible.

제한

예제 입력 1

3
2 835
2 100
1 100

예제 출력 1

44
5
100

힌트

출처

ICPC > Regionals > North America > South Central USA Regional > 2016 South Central USA Regional Programming Contest E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /