HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Linear Data Structures: Arrays > problem:


50563 - Long Modulus

Guest
• Review clarifications (1)

Section problems

• 51146 - Popular Baby Names
• 51131 - Running After a Thief
• 51143 - Departments Competition
• 50994 - The Most Crowded Station
• 51118 - Place 7 to the 5th position
• 51132 - Problem Solving Competition
• 51121 - Complexity power of a nu...
• 51119 - Evaluating Prefix expressions
• 50563 - Long Modulus
• 50594 - Transformations
• 51182 - Count and Sum 2
• 51193 - The max element of k-th co...
• 51194 - The difference between max...
• 51196 - The sum of two arrays
• 51197 - Even and odd Numbers
• 50468 - Draw Matrix - 2
• 50423 - Numbers square

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