B. National Projecttime
limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output
Your company was appointed to lay new asphalt on the highway of length nnSkipping the repair is necessary because of the climate. The climate in your region is periodical: there are ggbbggbbYou can be sure that you start repairing at the start of a good season, in other words, days 1,2,…,g1,2,…,gYou don’t really care about the quality of the highway, you just want to make sure that at least half of the highway will have high-quality pavement. For example, if the n=5n=533n=4n=422What is the minimum number of days is needed to finish the repair of the whole highway?InputThe first line contains a single integer TT1≤T≤1041≤T≤104Next TTnnggbb1≤n,g,b≤1091≤n,g,b≤109OutputPrint TTExampleinputCopy3
5 1 1
8 10 10
1000000 1 1000000
outputCopy5
8
499999500000
NoteIn the first test case, you can just lay new asphalt each day, since days 1,3,51,3,5In the second test case, you can also lay new asphalt each day, since days 1188
B. National Projecttime
最新推荐文章于 2024-10-07 15:49:08 发布