SarthakKeshari / CPP-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
47 stars 132 forks source link

Hacking Cypher #402

Closed rohitkumar9710 closed 2 years ago

rohitkumar9710 commented 2 years ago

Enter your question -

Polycarpus participates in a competition for hacking into a new secure messenger. He's almost won. Having carefully studied the interaction protocol, Polycarpus came to the conclusion that the secret key can be obtained if he properly cuts the public key of the application into two parts. The public key is a long integer which may consist of even a million digits! Polycarpus needs to find such a way to cut the public key into two nonempty parts, that the first (left) part is divisible by a as a separate number, and the second (right) part is divisible by b as a separate number. Both parts should be positive integers that have no leading zeros. Polycarpus knows values a and b.

Help Polycarpus and find any suitable method to cut the public key.

Enter link to the question(if question belongs to any online platform) -

https://codeforces.com/contest/490/problem/C

Tags for the question(eg - Array, Basic, Stack, etc.) -

Math, Number Theory, Rating: 1700

SarthakKeshari commented 2 years ago

@rohitkumar9710, Kindly add your solution to "Codeforces" folder Deadline - 10/10/2021