<\/span><\/h2>\n\n\n\nIntegers in Python can be as big as the bytes in your machine’s memory. There is no limit in size as there is:231<\/sup> – 1<\/strong> (c++ int) or 263<\/sup> – 1<\/strong> (C++ long long int).<\/p>\n\n\n\nAs we know, the result of ab<\/sup><\/em><\/strong> grows really fast with increasing b<\/em><\/strong>.<\/p>\n\n\n\nLet’s do some calculations on very large integers.<\/p>\n\n\n\n
<\/span>Task<\/strong><\/span><\/h2>\n\n\n\nRead four numbers, a<\/strong><\/em>, b<\/strong><\/em>, c<\/strong><\/em>, and d<\/strong><\/em>, and print the result of ab<\/sup><\/em> + cd<\/sup><\/em><\/strong>.<\/p>\n\n\n\n<\/span>Input Format<\/strong><\/span><\/h2>\n\n\n\nIntegers a, b, c,<\/strong><\/em> and d<\/strong><\/em> are given on four separate lines, respectively.<\/p>\n\n\n\n<\/span>Constraints<\/strong><\/span><\/h2>\n\n\n\n- 1 <= a<\/em> <= 1000<\/strong><\/li>
- 1 <= b<\/em> <= 1000<\/strong><\/li>
- 1 <= c<\/em> <= 1000<\/strong><\/li>
- 1 <= d<\/em> <= 1000<\/strong><\/li><\/ul>\n\n\n\n
<\/span>Output Format<\/strong><\/span><\/h2>\n\n\n\nPrint the result of ab<\/sup><\/em> + cd<\/sup><\/em><\/strong> on one line.<\/p>\n\n\n\nSample Input<\/strong><\/p>\n\n\n\n9\n29\n7\n27<\/code><\/pre>\n\n\n\nSample Output<\/strong><\/p>\n\n\n\n4710194409608608369201743232 <\/code><\/pre>\n\n\n\nNote<\/strong>: This result is bigger than 263<\/sup> – 1<\/strong>. Hence, it won’t fit in the long long int of C++ or a 64-bit integer.<\/p>\n\n\n\n<\/span>Solution – Integers Come In All Sizes In Python <\/strong><\/span><\/h2>\n\n\n\n# Enter your code here. Read input from STDIN. Print output to STDOUT\na = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\n\nprint((a**b)+(c**d))\n<\/pre>\n\n\n\n