{"problem":{"name":"C. Shahhoud Training Hussain","description":{"content":"Ever since coach Shahhoud started the series \"Problem Every Day\" . Hussain decided to train really hard. After all, he may get a chance to qualify for the upcoming SCPC contest ! Shahhoud gives Hussa","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":65536},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10191C"},"statements":[{"statement_type":"Markdown","content":"Ever since coach Shahhoud started the series \"Problem Every Day\" . Hussain decided to train really hard. After all, he may get a chance to qualify for the upcoming SCPC contest !\n\nShahhoud gives Hussain K problems everyday. However, Hussain can solve at most P problems everyday.\n\nAt the end of the Nth day of training, Shahhoud wants to know how many problems did Hussain miss and hasn't solved yet?\n\nThe first line contains an integer T, the number of test cases.\n\nEach line of the following T lines describes a single test case. Each test case contains 3 space separated integers K, P, N (1 ≤ K, P, N ≤ 109).\n\nFor each test case print a single line, containing a single integer, denoting the number of problems Hussain has missed by the end of the Nth day.\n\n## Input\n\nThe first line contains an integer T, the number of test cases.Each line of the following T lines describes a single test case. Each test case contains 3 space separated integers K, P, N (1 ≤ K, P, N ≤ 109).\n\n## Output\n\nFor each test case print a single line, containing a single integer, denoting the number of problems Hussain has missed by the end of the Nth day.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ N \\in \\mathbb{Z} $ be the number of lines.  \nLet $ S \\in \\mathbb{Z} $ be the shift value, with $ 1 \\leq S \\leq 10^9 $.  \nLet $ M_1, M_2, \\dots, M_N $ be the encrypted messages, each a string over the alphabet $ \\Sigma = \\{ \\text{a-z, A-Z, digits, spaces, punctuation} \\} $.  \n\nLet $ \\text{val}(c) $ be the numeric value of an alphabetic character $ c $:  \n- $ \\text{val}(c) = \\begin{cases} \n      c - \\text{'a'} & \\text{if } c \\in \\text{a-z} \\\\\n      c - \\text{'A'} & \\text{if } c \\in \\text{A-Z}\n   \\end{cases} $  \n\nLet $ \\text{char}_\\text{lower}(v) = \\text{chr}(\\text{'a'} + v \\bmod 26) $  \nLet $ \\text{char}_\\text{upper}(v) = \\text{chr}(\\text{'A'} + v \\bmod 26) $  \n\n**Constraints**  \n1. $ 1 \\leq N \\leq 10^3 $  \n2. $ 1 \\leq S \\leq 10^9 $  \n3. Total length of all messages $ \\leq 10^3 $  \n\n**Objective**  \nFor each message $ M_k $, decrypt each character $ c \\in M_k $ as follows:  \n- If $ c $ is lowercase alphabetic:  \n  $$\n  c' = \\text{char}_\\text{lower}\\left( (\\text{val}(c) - S) \\bmod 26 \\right)\n  $$  \n- If $ c $ is uppercase alphabetic:  \n  $$\n  c' = \\text{char}_\\text{upper}\\left( (\\text{val}(c) - S) \\bmod 26 \\right)\n  $$  \n- Otherwise: $ c' = c $  \n\nOutput the decrypted string for each $ M_k $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10191C","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}