HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > "Informatics Stars" Online Contests - 2011-2014 > problem:


2012-03-01. 50563 - Long Modulus

"Informatics Stars" Online Contests - 2011-2014

Start: Oct.20.2012 at 10:00:00 AM
Finish: Oct.20.2012 at 03:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 2011-11-1. 50565 - Binary numbers
• 2011-11-3. 50588 - Processing the li...
• 2012-02-2. 50577 - Perfect Numbers...
• 2012-02-4. 50594 - Transformations
• 2012-02-5. 50768 - Where is Waldorf?
• 2012-02-7. 50704 - Connected?
• 2012-02-8. 50596 - Your Ride Is He...
• 2012-02-8. 50596 - Your Ride Is He...
• 2012-03-01. 50563 - Long Modulus
• 2012-03-02. 50567 - Input Data No...
• 2012-03-04. 50597 - Drawing Diam...
• 2012-10-02. 50555 - Frequency of L...
• 2012-10-04. 50598 - Minimum Sum
• 2012-11-30. 50656 - Divisibility by 11
• 2012-11-40. 50558 - Biggest Barn
• 2012-12-10. 50546 - Average Fuel P...
• 2012-12-20. 50574 - Triangular Nu...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Long Modulus

Shqip

When we study programming, normally, we can do arithmetic operations on the numbers which are less than 2 billion or 4 billion (p.s. if you are using "long long" it can go until 20 digits :). 4 billion has 10 digits. Write a program that calculates the modulus (remainder) of a 200 digit number, after it's divided by another integer.

For Example: When 2244444444444444444444443 is divided by 2 the remainder is 1.
Ex.2: 12345678 Modulus 123 is 45.


Input specification
The first line contains an integer number n (where 1 ≤ n ≤ 200), the length of the dividend, then the dividend number (num) itself.
The secondline contains an integer divisor (d) where it's 1 ≤ d ≤ 2 billion.

Output specification
Show the remainder followed by an endline character.

 Sample Input 1  Sample Input 2
 5 33333
 987
 15 123456789012345
 654321
 Sample Output 1  Sample Output 2
 762  16305

Для отправки решений необходимо выполнить вход.

www.contester.ru