Integers Come In All Sizes Solution
1 min read

Integers Come In All Sizes 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: (c++ int) or (C++ long long int).
Integers Come In All Sizes 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:  (c++ int) or  (C++ long long int).

As we know, the result of  grows really fast with increasing .

Let's do some calculations on very large integers.

Task
Read four numbers, a, b, c, and d, and print the result of ab + cd.

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

Constraints



Output Format
Print the result of  on one line.

Sample Input

9
29
7
27

Sample Output

4710194409608608369201743232  

Note: This result is bigger than . Hence, it won't fit in the long long int of C++ or a 64-bit integer.

Solution in Python

a,b,c,d = [int(input()) for i in range(4)]
print(a**b+c**d)

Enjoying these posts? Subscribe for more


Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

That's okay. But without advertising-income, we can't keep making this site awesome.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add thepoorcoder.com to your ad blocking whitelist or disable your adblocking software.

×