{"raw_statement":[{"iden":"problem statement","content":"You are participating in a quiz with $N + M$ questions and Yes/No answers.\nIt's known in advance that there are $N$ questions with answer Yes and $M$ questions with answer No, but the questions are given to you in random order.\nYou have no idea about correct answers to any of the questions. You answer questions one by one, and for each question you answer, you get to know the correct answer immediately after answering.\nSuppose you follow a strategy maximizing the expected number of correct answers you give.\nLet this expected number be $P/Q$, an irreducible fraction. Let $M = 998244353$. It can be proven that a unique integer $R$ between $0$ and $M - 1$ exists such that $P = Q \\times R$ modulo $M$, and it is equal to $P \\times Q^{-1}$ modulo $M$, where $Q^{-1}$ is the modular inverse of $Q$. Find $R$."},{"iden":"constraints","content":"*   $1 \\leq N, M \\leq 500,000$\n*   Both $N$ and $M$ are integers."},{"iden":"partial score","content":"*   $1500$ points will be awarded for passing the testset satisfying $N = M$ and $1 \\leq N, M \\leq 10^5$."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $M$"},{"iden":"sample input 1","content":"1 1"},{"iden":"sample output 1","content":"499122178\n\nThere are two questions. You may answer randomly to the first question, and you'll succeed with 50% probability. Then, since you know the second answer is different from the first one, you'll succeed with 100% probability.\nThe expected number of your correct answers is $3$ / $2$. Thus, $P = 3$, $Q = 2$, $Q^{-1} = 499122177$ (modulo $998244353$), and $P \\times Q^{-1} = 499122178$ (again, modulo $998244353$)."},{"iden":"sample input 2","content":"2 2"},{"iden":"sample output 2","content":"831870297\n\nThe expected number of your correct answers is $17$ / $6$."},{"iden":"sample input 3","content":"3 4"},{"iden":"sample output 3","content":"770074220\n\nThe expected number of your correct answers is $169$ / $35$."},{"iden":"sample input 4","content":"10 10"},{"iden":"sample output 4","content":"208827570"},{"iden":"sample input 5","content":"42 23"},{"iden":"sample output 5","content":"362936761"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}