Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

Integers come in all sizes Hacker Rank solution – Queslers

Problem : Integers come in all sizes Hacker Rank solution

Integers in Python can be as big as the bytes in your machine’s memory. There is no limit in size as there is: 2^31 – 1 (c++ int) or 2^63 – 1 (C++ long long int).As we know, the result of a^b grows really fast with increasing b.
Let’s do some calculations on very large integers.
Task :Read four numbers, a, b, c, and d, and print the result of a^b + c^d.


Input Format :

Integers a, b, c, and d are given on four separate lines, respectively.

Constraints :

  • 1 <= a <= 1000
  • 1 <= b <= 1000
  • 1 <= c <= 1000
  • 1 <= d <= 1000

Output Format :

Print the result of  a^b + c^d on one line.


Sample Input :

9
29
7
27

Sample Output :

4710194409608608369201743232

Note: This result is bigger than 2^63 – 1. Hence, it won’t fit in the long long int of C++ or a 64-bit integer.

Integers come in all sizes Hacker Rank solution in python 2

a=int(input())
b=int(input())
c=int(input())
d=int(input())
print a**b+c**d

Integers come in all sizes Hacker Rank solution in python 3

# Enter your code here. Read input from STDIN. Print output to STDOUT
a,b,c,d = (int(input()) for _ in range(4))
print (pow(a,b)+pow(c,d))

Integers come in all sizes Hacker Rank solution in pypy

a = int(raw_input())
b = int(raw_input())
c = int(raw_input())
d = int(raw_input())
print a**b + c**d

Integers come in all sizes Hacker Rank solution in pypy 3

# Enter your code here. Read input from STDIN. Print output to STDOUT
a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(pow(a,b)+pow(c,d))
Integers come in all sizes Hacker Rank Solution Review:

In our experience, we suggest you solve this Integers come in all sizes Hacker Rank Solution and gain some new skills from Professionals completely free and we assure you will be worth it.

Integers come in all sizes is available on Hacker Rank for Free, if you are stuck anywhere between compilation, just visit Queslers to get all Hacker Rank Solution

Integers come in all sizes Hacker Rank Solution Conclusion:

I hope this Integers come in all sizes Hacker Rank Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Hacker Rank, Leetcode, Codechef, Codeforce Solution.

This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.

Keep Learning!

More Hacker Rank Problem & Solutions >>

Mini-Max Sum Hacker Rank Solution

String Validators Hacker Rank Solution

Text Alignment Hacker Rank solution

String validators Hacker Rank Solution

Staircase Hacker Rank Solution

Leave a Reply

Your email address will not be published. Required fields are marked *