{"problem":{"name":"A. Abnormal Words","description":{"content":"\"_Khoor!_\" David exclaimed to Aram. \"_Jreeohghbjrrn!_\" Aram responded. Dismayed to find that club members weren't sufficiently confused, Aram and David decided to speak in a new language. Rather inv","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10236A"},"statements":[{"statement_type":"Markdown","content":"\"_Khoor!_\" David exclaimed to Aram.\n\n\"_Jreeohghbjrrn!_\" Aram responded.\n\nDismayed to find that club members weren't sufficiently confused, Aram and David decided to speak in a new language. Rather invent one from scratch, they decided to encode their speech with a Caesar cipher.\n\nSpecifically, they agree on the _Caesar shift_ $s$. To say a word, they replace each of its letters by the letter that comes $s$ places later in the alphabet. Letters that pass _z_ wrap back around to _a_. For example if $s = 4$, _a_ becomes _e_, _b_ becomes _f_, and _y_ becomes _c_.\n\nEncoding and decoding words in their heads is very slow, so David and Aram asked you to write a program to automate this process. After all, they're still untangling their tongues after saying _jreeohghbjrrn_!\n\nThe first line contains a single character, either \"_E_\" or \"_D_\", indicating whether Aram and David are requesting a word to encode or decode, respectively.\n\nThe second line contains a integer $s$ ($1 <= s <= 25$), the shift.\n\nThe third line contains a single word $w$ ($1 <= | w | <= 100$) consisting solely of the lowercase Latin letters from _a_ to _z_.\n\nOn a single line output the encrypted or decrypted word, as requested.\n\n## Input\n\nThe first line contains a single character, either \"_E_\" or \"_D_\", indicating whether Aram and David are requesting a word to encode or decode, respectively.The second line contains a integer $s$ ($1 <= s <= 25$), the shift.The third line contains a single word $w$ ($1 <= | w | <= 100$) consisting solely of the lowercase Latin letters from _a_ to _z_.\n\n## Output\n\nOn a single line output the encrypted or decrypted word, as requested.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ A, B, C \\in \\mathbb{Z}^+ $ with $ 1 \\leq A, B, C \\leq 1000 $.  \nLet $ K \\in \\mathbb{Z}^+ $ be the number of cake pieces, with $ K \\leq 5000 $.  \nFor each piece $ i \\in \\{1, \\dots, K\\} $, define:  \n- $ w_i \\in \\mathbb{R}^+ $: weight of piece $ i $,  \n- $ a_i \\in \\{1, \\dots, A\\} $: recipient index if $ A $ guests arrive,  \n- $ b_i \\in \\{1, \\dots, B\\} $: recipient index if $ B $ guests arrive,  \n- $ c_i \\in \\{1, \\dots, C\\} $: recipient index if $ C $ guests arrive.  \n\n**Constraints**  \n1. $ \\sum_{i=1}^K w_i \\leq 10^{18} $  \n2. For each $ i \\in \\{1, \\dots, K\\} $:  \n   - $ w_i > 0 $,  \n   - $ 1 \\leq a_i \\leq A $,  \n   - $ 1 \\leq b_i \\leq B $,  \n   - $ 1 \\leq c_i \\leq C $.  \n3. $ K \\leq 5000 $  \n\n**Objective**  \nPartition the cake into $ K $ pieces such that:  \n- When $ A $ guests arrive, the pieces can be partitioned into $ A $ groups (one per guest) with equal total weight.  \n- When $ B $ guests arrive, the pieces can be partitioned into $ B $ groups with equal total weight.  \n- When $ C $ guests arrive, the pieces can be partitioned into $ C $ groups with equal total weight.  \n\nThat is, for each $ x \\in \\{A, B, C\\} $, the multiset $ \\{w_i\\} $ can be partitioned into $ x $ subsets, each summing to $ \\frac{W}{x} $, where $ W = \\sum_{i=1}^K w_i $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10236A","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}