Skip to content

Latest commit

 

History

History

integers-come-in-all-sizes

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Integers Come In All Sizes

https://www.hackerrank.com/challenges/python-integers-come-in-all-sizes

Problem

Integers in Python can be as big as the bytes in your machine's memory. There is no limit in size as there is: 231 - 1 (c++ int) or 263 - 1 (C++ long long int).

As we know, the result of ab 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 ab + cd.

Input Format

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

Output Format

Print the result of ab + cd on one line.

Sample Input 0

9
29
7
27

Sample Output 0

4710194409608608369201743232

My Solution