Tournament
Word-landia is a newly formed country, created by merging two ancient states due to external threats. These states are now provinces within Word-landia, temporarily named Senior and Junior Byte-landia until official names are decided through referendums.
To foster unity among the population, a championship between the provinces has been organized. In Senior Byte-landia, chess is the national game, while in Junior Byte-landia, it's volleyball. Consequently, the championship will feature a mix of chess and volleyball matches. To keep the championship concise, exactly K matches will be played. Each match will either be a chess or a volleyball game. The winner of a match earns one point in the championship standings, and if a chess game ends in a draw, both provinces receive 0.5 points each.
The government aims for the championship to end in a tie, meaning both provinces should score the same number of points. Therefore, they have tasked you with determining the minimum number of chess games required to minimize the difference in expected points between the provinces.
Historically, it is known that Senior Byte-landia has a probability of p_1 of winning a chess game against Junior Byte-landia and a probability of p_2 of losing a volleyball match. A chess game ends in a draw with a probability of p_3.
**Note**: The expected value in probability theory is the average value of a random variable. For a discrete random variable X with a probability distribution P(X = x_i) = p_i, the expected value is the sum of the products of all possible values of the random variable and their corresponding probabilities.
**Input**
The first line contains a natural number indicating the number of test cases. Each test case consists of four integers: K (1 < K ≤ 10^16), p_1, p_2, p_3 (0 ≤ p_1, p_2, p_3 ≤ 100), representing the number of matches and the probabilities in percentages.
**Output**
For each test case, output a single natural number on a separate line, representing the minimum number of chess games needed (ensuring the championship does not become solely a chess tournament).