Advanced Arithmetic
Let us consider the task of representing very large numbers in C. As we know we cannot store an intger of maximum value 263-1 and minimum value -263 sing a long long data type in C. But how do we represent numbers which are not in this range, say for example 1050.In one of the problems we ask you to do this and explain how it is done usually.
Problem 1:
The task is to accomplish addition of two large positive numbers
Input Specification
There will be two positive integers (< 10^50) separated by a space.
Output Specification
Output must contain a single number representing the sum of the two integers
Sample Input and Output
Input: 323289329329392893 3283928392839283928932329
Output:3283928716128613258325222
Input: 10 99
Output: 109
Problem 2:
Find the square root of a positive integer using binary search.
Input Specification
Input will contain a single positive integer N input from keyboard, lesser than 10^9.
Output Specification
Print the square root of the number upto 4 decimal places. A difference upto 0.001 from the the judges solution will be accepted as correct.
Sample Input and Output
Input: 5
Output: 2.2361
Input: 25
Output: 5.0000