PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000165. Mua xẻng theo gói (Buying Shovels)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Mua xẻng theo gói (Buying Shovels)
Buying Shovels
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
A shop has unlimited packs of shovels. There are pack sizes: size contains exactly shovels, for every . Polycarp wants exactly shovels and must buy packs of a single size. Find the minimum number of packs needed.
Input
One line containing two positive integers .
Output
Print the minimum possible number of packs.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
8 7
Output
2
Explanation
Two packs containing shovels each give exactly . One pack cannot work because a pack of size is unavailable when .