{"raw_statement":[{"iden":"statement","content":"Abhinav is far away from his home on Halloween night! He's incredible scared of being attacked by ghosts, so he wants to run home as quick as he can to maximize his chance of making it through the night safely. \n\nWe can model Abhinav's position and his home's position as points on a number line as $a$ and $h$, respectively. In a single second, Abhinav can move anywhere between $1$ and $d$ units. Given $a$, $h$, and $d$, can you figure out how fast Abhinav can make it back home?\n\nThe first line will consist of a single integer $T$ ($1 <= T <= 1000$) consisting of the number of test cases you will need to process. The next $T$ lines each consist of a single test case with $3$ space separated integers $a$, $h$, $d$ ($1 <= a, h, d <= 10^5$), which represent Abhinav's position, his home's position, and his max speed. \n\nFor each test case, output a single integer giving the minimum amount of time (in seconds) it will take Abhinav to reach his home.\n\n"},{"iden":"input","content":"The first line will consist of a single integer $T$ ($1 <= T <= 1000$) consisting of the number of test cases you will need to process. The next $T$ lines each consist of a single test case with $3$ space separated integers $a$, $h$, $d$ ($1 <= a, h, d <= 10^5$), which represent Abhinav's position, his home's position, and his max speed. "},{"iden":"output","content":"For each test case, output a single integer giving the minimum amount of time (in seconds) it will take Abhinav to reach his home."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ S \\in \\Sigma^* $ be a string over $ \\Sigma = \\{ \\text{a}, \\text{b}, \\dots, \\text{z} \\} $, initially of length $ n $.  \nLet $ q \\in \\mathbb{Z}^+ $ be the number of operations.  \n\n**Operations**  \nFor each of the $ q $ operations:  \n1. **Delete**: Given $ l, r $, remove all characters at positions $ l $ to $ r $ inclusive.  \n2. **Insert**: Given character $ c \\in \\Sigma $ and position $ p $, insert $ c $ at position $ p $; shift all characters at positions $ \\geq p $ one position right.  \n3. **Query**: Given $ l, r $, determine whether the substring $ S[l:r] $ is a palindrome.  \n\n**Constraints**  \n1. $ 1 \\leq n, q \\leq 3 \\cdot 10^5 $  \n2. For each operation:  \n   - Type 1: $ 1 \\leq l \\leq r \\leq |S| $  \n   - Type 2: $ 1 \\leq p \\leq |S| + 1 $, $ c \\in \\Sigma $  \n   - Type 3: $ 1 \\leq l \\leq r \\leq |S| $  \n3. $ S $ initially contains no combined \"ae\" character.  \n\n**Objective**  \nFor each type-3 query, output \"yes\" if $ S[l:r] $ is a palindrome, otherwise \"no\".  \nAll operations modify $ S $ in-place, and queries must be processed online.","simple_statement":"You have a string of lowercase letters. Perform q operations:  \n1. Delete characters from position l to r.  \n2. Insert character c at position p (shift others right).  \n3. Check if substring from l to r is a palindrome.  \nFor each type 3 query, print \"yes\" or \"no\".","has_page_source":false}