Given is a positive integer N. We have taken all rational numbers in the interval [0,1] that can be expressed as a fraction with denominator at most equal to N. We have then ordered all of these rational numbers and we assigned them 0-based ordinal numbers. Your task is to convert between these rational numbers and their ordinal numbers. ------------------------------------------------------------------------------------------------- The input starts with a line containing Q: the number of queries (between 1 and 10, inclusive). Each query is given in a single line. There are two types of queries: "0 N X" and "1 N A B". You may assume that: 1 <= N <= 10^5 0 <= X <= 10^15 0 <= A <= 10^15 1 <= B <= 10^15 ------------------------------------------------------------------------------------------------- In queries of both types, N is the upper bound on the denominator, as stated above. For each query, output a single line with the answer to that query. For each query of the first type, find the rational number with the ordinal number X and output it as a reduced fraction in the form "A/B". (Print "/B" even if B=1.) If there is no rational number with the given ordinal number, output "none" instead. For each query of the second type, take the rational number represented by the (not necessarily reduced) fraction A/B and output its ordinal number X. If the given fraction has no ordinal number, output "none" instead. ------------------------------------------------------------------------------------------------- Example input: 4 0 8 15 1 8 4 6 0 8 47 1 8 6 4 Example output: 2/3 15 none none Explanation: These are all the valid rationals for N = 8: 0/1, 1/8, 1/7, 1/6, 1/5, 1/4, 2/7, 1/3, 3/8, 2/5, 3/7, 1/2, 4/7, 3/5, 5/8, 2/3, 5/7, 3/4, 4/5, 5/6, 6/7, 7/8, 1/1. - The ordinal number 15 corresponds to the fraction 2/3. - The fraction 4/6 is the same as 2/3 so its ordinal number is 15. - There are only 23 rationals in the above list, so none of them has an ordinal number of 47. - The list does not contain the rational 6/4.