{"problem":{"name":"B. Divples","description":{"content":"After your death, you're sent to a mysterious room. There are two guardian cats and two doors, one goes to heaven of AC problems and another goes to hell NO. One cat likes all divisors of an integer a","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":65536},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10230B"},"statements":[{"statement_type":"Markdown","content":"After your death, you're sent to a mysterious room. There are two guardian cats and two doors, one goes to heaven of AC problems and another goes to hell NO. One cat likes all divisors of an integer a and the other cat likes all multiples of an integer b. You where asked to write all integers that satisfies both. If you answer correctly, you may go to heaven of AC problems, full of balloons, otherwise you're sent to hell NO.\n\nThe input consists of two integers a and b, where 1 ≤ b ≤ a ≤ 1012.\n\nThe output consists of one line with all integers from smallest to largest that satisfies both guardian cats.\n\n## Input\n\nThe input consists of two integers a and b, where 1 ≤ b ≤ a ≤ 1012.\n\n## Output\n\nThe output consists of one line with all integers from smallest to largest that satisfies both guardian cats.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n, k \\in \\mathbb{Z} $ with $ 1 \\leq n, k \\leq 10^{18} $.  \nLet $ S_n $ be the sequence of moves generated by the brute-force Hanoi Tower algorithm for $ n $ disks, where each move is represented as a string of the form \"disk from peg A to peg B\".\n\n**Constraints**  \n1. $ 1 \\leq n, k \\leq 10^{18} $  \n2. The total number of moves in $ S_n $ is $ 2^n - 1 $.  \n\n**Objective**  \nFor each test case:  \n- If $ k > 2^n - 1 $, output `\"Orz\"`.  \n- Otherwise, output the $ k $-th move in $ S_n $, where moves are ordered by execution in the standard recursive Hanoi algorithm:  \n  The $ i $-th move (1-indexed) corresponds to moving disk $ d $ from source to target, where:  \n  $$\n  d = \\nu_2(i) + 1, \\quad \\text{and the direction is determined by parity of } n \\text{ and } d\n  $$  \n  Specifically, for disk $ d $, its movement cycle is periodic with period $ 2^d $, and the direction alternates based on $ n \\mod 2 $ and $ d \\mod 2 $.  \n\n  The source and target pegs for the $ i $-th move can be computed via:  \n  Let $ d = \\nu_2(i) + 1 $, and let $ r = \\left\\lfloor \\frac{i - 1}{2^d} \\right\\rfloor \\mod 3 $.  \n  Then:  \n  - If $ n $ is even:  \n    - $ d $ odd: cycle $ A \\to C \\to B \\to A $  \n    - $ d $ even: cycle $ A \\to B \\to C \\to A $  \n  - If $ n $ is odd:  \n    - $ d $ odd: cycle $ A \\to B \\to C \\to A $  \n    - $ d $ even: cycle $ A \\to C \\to B \\to A $  \n\n  The peg sequence for disk $ d $ is determined by the above cycle, indexed by $ r $.  \n\n  Output the move as: `\"disk d from X to Y\"` where $ X, Y $ are the source and target pegs from the cycle.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10230B","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}