PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000037. Đếm số lần trừ để hai số bằng nhau (Count Subtractions)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Đếm số lần trừ để hai số bằng nhau (Count Subtractions)
Count Subtractions
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
Given positive integers , repeatedly subtract the smaller one from the larger one until . Count the number of subtractions until the two values become equal.
Input
One line contains .
Output
Print the number of subtractions.
Subtasks
- Subtask 1 (20 points):
- Subtask 2 (30 points):
- Subtask 3 (50 points):
Examples
Input
3 8
Output
4
Explanation
The states are : exactly four subtractions.