Big P and Math
Practice
4.5 (4 votes)
Basic programming
Open
Approved
Easy
Problem
51% Success 5410 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Big P is fairly good in mathematics.
His teacher has asked him to add two numbers.
Now , Big P has a problem that he sometimes writes a '6' as a '5' and vice versa.
Given two numbers, A and B, calculate the minimum and the maximum sum Big P could possibly get.

Input:
The first and only line of input contains positive integers A and B .

Output:
In single line of output, print two space separated integers, minimum and maximum sum Big P could get.

Constraints:
1<= A,B <= 1000000

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
19 votes
Tags:
Basic MathAlgorithmsMath
Points:20
6 votes
Tags:
Basic ProgrammingOpenApprovedEasyMathamatics
Points:20
1 votes
Tags:
Easy