{"raw_statement":[{"iden":"problem statement","content":"$10^{10^{10}}$ participants, including Takahashi, competed in two programming contests. In each contest, all participants had distinct ranks from first through $10^{10^{10}}$\\-th.\nThe _score_ of a participant is the product of his/her ranks in the two contests.\nProcess the following $Q$ queries:\n\n*   In the $i$\\-th query, you are given two positive integers $A_i$ and $B_i$. Assuming that Takahashi was ranked $A_i$\\-th in the first contest and $B_i$\\-th in the second contest, find the maximum possible number of participants whose scores are smaller than Takahashi's."},{"iden":"constraints","content":"*   $1 \\leq Q \\leq 100$\n*   $1\\leq A_i,B_i\\leq 10^9(1\\leq i\\leq Q)$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$Q$\n$A_1$ $B_1$\n$:$\n$A_Q$ $B_Q$"},{"iden":"sample input 1","content":"8\n1 4\n10 5\n3 3\n4 11\n8 9\n22 40\n8 36\n314159265 358979323"},{"iden":"sample output 1","content":"1\n12\n4\n11\n14\n57\n31\n671644785\n\nLet us denote a participant who was ranked $x$\\-th in the first contest and $y$\\-th in the second contest as $(x,y)$.\nIn the first query, $(2,1)$ is a possible candidate of a participant whose score is smaller than Takahashi's. There are never two or more participants whose scores are smaller than Takahashi's, so we should print $1$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}