Hide

Problem A
Jacobi Symbol

Languages en is

Compute the Jacobi Symbol (ab).

Input

First line consist of an integer 231a2311. The second line consists of an odd integer 3b2311.

Output

Write a single line with (ab){1,0,1}.

Sample Input 1 Sample Output 1
-15750
37907
1
Hide

Please log in to submit a solution to this problem

Log in