Editorial for Bedao Mini Contest 11 - SQRCUT
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Ta dễ nhận ra số lần thực hiện thao tác cắt cho đến khi ~A < B~ là ~\frac{A}{B}~ , sao đó chỉ cần đổi giá trị ~A~ và ~B~ với nhau . Nói tóm lại ta chỉ cần thực hiện hai thao tác
- Tính số lần cắt bằng cách lấy ~\frac{A}{B}~ ,thực hiện trừ ~A~ đi một khoảng.
- Nếu ~A < B~ thì hoán đổi hai giá trị ~A~ và ~B~
Comments