{"problem":{"name":"D. Treasure Box","description":{"content":"Your team was exploring an ancient city. Suddenly you found an old scroll with 2 integer numbers N and K, which encrypts the secret code to open a treasure box. Considering a transformation on an inte","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10054D"},"statements":[{"statement_type":"Markdown","content":"Your team was exploring an ancient city. Suddenly you found an old scroll with 2 integer numbers N and K, which encrypts the secret code to open a treasure box. Considering a transformation on an integer X described as follows:\n\nX = X + X mod 100,\n\nthe secret code can be obtained by applying the above-described transformation K times successively to N.\n\nThe input file consists of several datasets. The first line of the input file contains the number of datasets which is a positive integer and is not greater than 500. \n\nEach dataset has two space-separated positive integers N and K (1 ≤ N ≤ 109, 1 ≤ K ≤ 109) written on a single line.\n\nFor each dataset, write on a single line the secret number decrypted from N and K.\n\n## Input\n\nThe input file consists of several datasets. The first line of the input file contains the number of datasets which is a positive integer and is not greater than 500. Each dataset has two space-separated positive integers N and K (1 ≤ N ≤ 109, 1 ≤ K ≤ 109) written on a single line.\n\n## Output\n\nFor each dataset, write on a single line the secret number decrypted from N and K.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ t \\in \\mathbb{Z} $ be the number of datasets.  \nLet $ D = \\{(N_j, K_j) \\mid j \\in \\{1, \\dots, t\\}\\} $ be the set of datasets, where for each $ j $:  \n- $ N_j \\in \\mathbb{Z}^+ $ is the initial integer.  \n- $ K_j \\in \\mathbb{Z}^+ $ is the number of transformations.  \n\n**Constraints**  \n1. $ 1 \\le t \\le 500 $  \n2. For each $ j \\in \\{1, \\dots, t\\} $:  \n   - $ 1 \\le N_j \\le 10^9 $  \n   - $ 1 \\le K_j \\le 10^9 $  \n\n**Objective**  \nFor each dataset $ j $, define the transformation $ f(x) = x + (x \\bmod 100) $.  \nCompute the result after $ K_j $ applications:  \n$$\nR_j = f^{K_j}(N_j)\n$$  \nwhere $ f^k $ denotes the $ k $-fold composition of $ f $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10054D","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}