Submit | All submissions | Best solutions | Back to list |
BINA - Binary Again |
One day I was playing card game on the computer of ACM ICPC Training Lab and my friend Istiyak was thinking something. Suddenly he said, “Munna, can you tell me whether A is divisible B or not?”.
Then I said to him, “That’s very simple! tell me A and B”. Then he said, “That’s not simple as you are thinking. I will tell you the binary of A and B”. Then he asked me that can I do it now?
I am not the man who can be defeated easily. But I also don’t know how to do it. As you are a good friend of mine. You are going to complete this task in my favor.
Input
On the first line you will be given the test case number T (T < 255).
Then for each test case you will be given two set of binary number, one on each line. Each set of binary will fit in 64 bit integers.
Output
For each test case print the test case number and print “YES” if A is divisible by B, otherwise print “NO” without quotes.
Example
Input: 3 11010 10 1111 11 111 11 Output: Case 1: YES Case 2: YES Case 3: NO
Problem Setter: Monjurul Huda Munna
Special thanks: MD Istiyak Ahmed, Shuvo Karmakar. Daffodil International University, Dhaka
Added by: | shuvo karmakar |
Date: | 2015-06-19 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 JS-MONKEY |
hide comments
|
|||||
2015-06-20 10:34:57 gamer496
Seems like many python solutions are giving nzec for this problem |
|||||
2015-06-20 09:49:13 Piyush Kumar
Should be moved to tutorial. |
|||||
2015-06-19 23:01:00 Pranjal Shankhdhar
Is this a joke? |