PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000007. Phép chia số nguyên rất lớn (Large Division)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Phép chia số nguyên rất lớn (Large Division)
Large Division
Source: LightOJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given integers and , where can contain hundreds of decimal digits and is a nonzero signed 32-bit integer, determine whether is divisible by . Negative signs do not affect divisibility.
Input
One line with integers and .
Output
Print divisible if is divisible by , otherwise not divisible.
Subtasks
- Subtask 1 (20 points): ;
- Subtask 2 (30 points): ;
- Subtask 3 (50 points): ; ; ; The representation has no leading zeros except the number zero.
Examples
Input
7678123668327637674887634 101
Output
not divisible
Explanation
Processing the decimal digits modulo gives a nonzero remainder, so the number is not divisible.