{"raw_statement":[{"iden":"statement","content":"Let's say we would like to give change of $d$ dollars after a puchase of coffee. The only coins that we can use have values $a$, $a + 1$, ..., $b$. Is it possible to give out the change? We are interested in even harder quesion: for given $d$ and $a$ what is the smallest $b$ such that the change can be given?\n\nThe input is two numbers $1 <= a <= d <= 10^9$.\n\nPrint smallest $b$ such that $d$ is a sum of coins from range $a,..., b$.\n\n"},{"iden":"input","content":"The input is two numbers $1 <= a <= d <= 10^9$."},{"iden":"output","content":"Print smallest $b$ such that $d$ is a sum of coins from range $a,..., b$."},{"iden":"examples","content":"Input19 60\nOutput20\nInput100 914\nOutput102\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ t \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, t\\} $, let $ n_k \\in \\mathbb{Z} $ be the target value.  \nInitial state: $ a = 1 $, $ x = 0 $.  \n\n**Operations**  \nIn one operation, choose one of:  \n1. $ x \\leftarrow x + a $  \n2. $ a \\leftarrow x $, then $ x \\leftarrow x + a $  \n\n**Objective**  \nFor each $ n_k $, find the minimum number of operations to reach $ x = n_k $.","simple_statement":"You start with a=1, x=0.  \nIn one move, you can either:  \n1. x = x + a,  \n2. a = x, then x = x + a.  \n\nFind the minimum number of moves to make x = n.","has_page_source":false}