Submeter | Todas submissőes | Melhores | Voltar |
Problem hidden
ADAGAME - Ada and Game |
Ada the Ladybug is playing Game of Digits against her friend Velvet Mite Vinit. The game is played in following manner: At first, there is a four-digit number and a number of moves. Both Ada and Vinit take turns alternately (beginning with Ada). Both of them must increase ANY digit of the number, but if the digit was 9 it will become 0.
For example number 3590 can be expanded to: 4590, 3690, 3500 or 3591. If after all turns the number is greater than the original number, Ada wins - otherwise Vinit is the winner. Both of them play optimally - can you decide who is the winner?
PS: It is possible, that Ada will have one more turn (if number of turns is odd)
Input
First line of input will consist T ≤ 200 number of test-cases. Each testcase will consist of four digit number 0 ≤ N < 104 [the original number] and 0 ≤ M ≤ 100 [the number of turns].
Output
For each test-case, print the name of winner ("Ada" or "Vinit").
Example Input
5 0000 0 5566 3 3333 10 9999 9 1234 30
Example Output
Vinit Ada Ada Vinit Ada
Adicionado por: | Morass |
Data: | 2016-09-06 |
Tempo limite: | 4.5s |
Tamanho do fonte: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Linguagem permitida: | Todas exceto: ASM64 CLOJURE ERL FSHARP GOSU PERL6 PY_NBC SCALA TCL |