{"problem":{"name":"A. Modular Exponentiation","description":{"content":"The following problem is well-known: given integers _n_ and _m_, calculate <center>,</center>where 2_n_ = 2·2·...·2 (_n_ factors), and denotes the remainder of division of _x_ by _y_. You are asked ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF913A"},"statements":[{"statement_type":"Markdown","content":"The following problem is well-known: given integers _n_ and _m_, calculate\n\n<center>,</center>where 2_n_ = 2·2·...·2 (_n_ factors), and denotes the remainder of division of _x_ by _y_.\n\nYou are asked to solve the \"reverse\" problem. Given integers _n_ and _m_, calculate\n\n<center>.</center>\n\n## Input\n\nThe first line contains a single integer _n_ (1 ≤ _n_ ≤ 108).\n\nThe second line contains a single integer _m_ (1 ≤ _m_ ≤ 108).\n\n## Output\n\nOutput a single integer — the value of .\n\n[samples]\n\n## Note\n\nIn the first example, the remainder of division of 42 by 24 = 16 is equal to 10.\n\nIn the second example, 58 is divisible by 21 = 2 without remainder, and the answer is 0.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"以下问题是众所周知的：给定整数 #cf_span[n] 和 #cf_span[m]，计算\n\n其中 #cf_span[2n = 2·2·...·2]（#cf_span[n] 个因子），且  表示 #cf_span[x] 除以 #cf_span[y] 的余数。\n\n你被要求解决这个“逆向”问题。给定整数 #cf_span[n] 和 #cf_span[m]，计算\n\n第一行包含一个整数 #cf_span[n]（#cf_span[1 ≤ n ≤ 108]）。\n\n第二行包含一个整数 #cf_span[m]（#cf_span[1 ≤ m ≤ 108]）。\n\n请输出一个整数 ——  的值。\n\n在第一个示例中，42 除以 #cf_span[24 = 16] 的余数等于 10。\n\n在第二个示例中，58 能被 #cf_span[21 = 2] 整除，余数为 0。\n\n## Input\n\n第一行包含一个整数 #cf_span[n]（#cf_span[1 ≤ n ≤ 108]）。第二行包含一个整数 #cf_span[m]（#cf_span[1 ≤ m ≤ 108]）。\n\n## Output\n\n请输出一个整数 ——  的值。\n\n[samples]\n\n## Note\n\n在第一个示例中，42 除以 #cf_span[24 = 16] 的余数等于 10。在第二个示例中，58 能被 #cf_span[21 = 2] 整除，余数为 0。","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"Given integers $ n $ and $ m $, compute:\n\n$$\n2^n \\bmod m\n$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF913A","tags":["implementation","math"],"sample_group":[["4\n42","10"],["1\n58","0"],["98765432\n23456789","23456789"]],"created_at":"2026-03-03 11:00:39"}}