Given X and Y whose values are greater than 2, the task is to find out which is maximum among
x^(y^2) and y^(x^2)
Consider that either x is greater than y or y is greater than x. So, print 1 if x^(y^2) is greater or 2 if y^(x^2) is greater.
Input: X = 4, Y = 9 Output: 1 Input: X = 4, Y = 3 Output: 2
Approach: Assume , then after taking ln on both sides and dividing by we can get .
Take . This function is monotonically decreasing for .
If x > y, then F(x) < F(y)
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Find maximum value of x such that n! % (k^x) = 0
- Find the maximum value of Y for a given X from given set of lines
- Find the maximum possible value of a[i] % a[j] over all pairs of i and j
- Find the maximum element in the array other than Ai
- Find the Substring with maximum product
- Find maximum operations to reduce N to 1
- Given count of digits 1, 2, 3, 4, find the maximum sum possible
- Find the maximum length of the prefix
- Find the maximum possible value for the given periodic function
- Find three integers less than or equal to N such that their LCM is maximum
- Find pair with maximum GCD in an array
- Find permutation with maximum remainder Sum
- Find a positive number M such that gcd(N^M, N&M) is maximum
- Find the node whose sum with X has maximum set bits
- Find the maximum number of handshakes
- Find a pair from the given array with maximum nCr value
- Find maximum xor of k elements in an array
- Find the maximum possible value of the minimum value of modified array
- Find a pair (n,r) in an integer array such that value of nPr is maximum
- Find a pair (n,r) in an integer array such that value of nCr is maximum
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.