Password
Practice
4 (4 votes)
Basics of bit manipulation
Modular arithmetic
Problem
89% Success 640 Attempts 20 Points 2s Time Limit 256MB Memory 1024 KB Max Code

Alice and Kalice are two friends. Bob, a security expert, gave each of them a binary number as a birthday present. Now Bob wants to register on hackerearth, for which he needs to create a strong password. He added the two numbers and wrote the sum in decimal form. Since the password must not be too long, so he took the remainder of the sum with (1e9 + 7)(a prime number) and set it as his secret password.


Since Bob is remains quite busy as he is a security expert. He forgot the password. He wish to participate in PCON round 1. So he went to the two friends and ask them to return the present, so weird :(


As he has to practice some problems before the contest, he gives you the two binary numbers. Can you tell him his password ? 


Input Format

The two line contains binary numbers of Alice and Kalice respectively : n1 and n2.


Constraints

1<= length of (n1,n2) <= 1e5.

It is guaranteed that both n1 and n2 starts with 1.

 

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
2 votes
Tags:
Modular arithmeticSimple-mathEasy
Points:20
1 votes
Tags:
Data StructuresBrute ForceMathModulus ArithmeticC++Number Theory
Points:20
3 votes
Tags:
MathematicsModular arithmeticEasy