Editorial for Xe đồ chơi


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.

Để xe đi được quãng đường dài nhất trong mỗi lần kéo, ta sẽ kéo xe lùi về sau hết cỡ.

Quãng đường mà xe đi được sau một lần kéo là \(S = -b + ab\). Ta lấy \(n\) chia cho \(S\), xong làm tròn lên (vì nếu chia có dư thì vẫn cần thêm một lần để xe vượt qua vạch đích).



Comments

There are no comments at the moment.