PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000018. Số khổng lồ kỳ diệu (The Huge One)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Số khổng lồ kỳ diệu (The Huge One)
The Huge One
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
Given nonnegative decimal integer (possibly very long) and a set of distinct integers from to , label Wonderful if it is divisible by every element of , or Simple otherwise. Preserve its decimal spelling.
Input
The first line has ; the second has followed by its distinct divisors.
Output
Print M - Wonderful. or M - Simple..
Subtasks
- Subtask 1 (20 points): ;
- Subtask 2 (30 points): ;
- Subtask 3 (50 points): ; ; Divisors are distinct and lie in the range 1 through 12.
Examples
Input
10
3 1 2 9
Output
10 - Simple.
Explanation
is divisible by and but not , so it is Simple.