시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
20 초 (추가 시간 없음) | 1024 MB | 68 | 28 | 22 | 40.741% |
Professor Math is working on a secret project and is facing a challenge where a list of numbers need to be encoded into a single number in the most efficient manner. After much research, Professor Math finds a 3 step process that can best encode the numbers:
The professor has shared an example and its explanation below. Given a list of numbers, can you help the professor build an efficient function to compute the final encoded number?
The first line of the input gives the number of test cases, T. This is followed by T test cases where each test case is defined by 2 lines:
For each test case, output one line containing Case #x: y
, where x
is the test case number (starting from 1) and y
is the final encoded number.
Since the output can be a really big number, we only ask you to output the remainder of dividing the result by the prime 109 + 7 (1000000007).
1 4 3 6 7 9
Case #1: 44
Contest > Google > Kick Start > Google Kick Start 2017 > Round B A번