Greater power
Submissions: 440   Accuracy:

15.19%

  Difficulty: Easy   Marks: 2

Given four integers a,b,m,n . Find whether  pow(a,b) is greater than pow(m,n) or not. Where pow(x,y) denotes x raised to the power y.

Input:
First line of input contains of an integer 'T 'denoting number of test cases .Only line of each testcase contains four integers a,b,m and n.

Output:
For each case in a new line print 1 if pow(a,b) is greater , print 0 if pow(m,n) is greater else print -1 if both are equal.

Constraints:
1 <= T <= 1000
0 <= b,n <= 1018
1 <= a,m <= 1018

Example:
Input:
2
2 2 3 2
1 23 1 34

Output:
0
-1

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Hardik Gulati
Author: hardikgulati96


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.