{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe number \u003ci\u003ex\u003c/i\u003e is called a square root of \u003ci\u003ea\u003c/i\u003e modulo \u003ci\u003en\u003c/i\u003e (root(\u003ci\u003ea\u003c/i\u003e,\u003ci\u003en\u003c/i\u003e)) if \u003ci\u003ex\u003c/i\u003e*\u003ci\u003ex\u003c/i\u003e \u003d \u003ci\u003ea\u003c/i\u003e (mod \u003ci\u003en\u003c/i\u003e). Write the program to find the square root of number \u003ci\u003ea\u003c/i\u003e by given modulo \u003ci\u003en\u003c/i\u003e.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eOne number \u003ci\u003eK\u003c/i\u003e in the first line is an amount of tests (\u003ci\u003eK\u003c/i\u003e ≤ 100000). Each next line represents separate test, which contains integers \u003ci\u003ea\u003c/i\u003e and \u003ci\u003en\u003c/i\u003e (1 ≤ \u003ci\u003ea\u003c/i\u003e, \u003ci\u003en\u003c/i\u003e ≤ 32767, \u003ci\u003en\u003c/i\u003e is prime, \u003ci\u003ea\u003c/i\u003e and \u003ci\u003en\u003c/i\u003e are relatively prime).\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eFor each input test the program must evaluate all possible values root(\u003ci\u003ea\u003c/i\u003e,\u003ci\u003en\u003c/i\u003e) \r\nin the range from 1 to \u003ci\u003en\u003c/i\u003e − 1 and output them in increasing order in one separate line using spaces. If there is no square root for current test, the program must print in separate line: ‘No root’.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\r\n4 17\r\n3 7\r\n2 7\r\n14 31\r\n10007 20011\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2 15\r\nNo root\r\n3 4\r\n13 18\r\n5382 14629\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}