Masala #0870
Sardor va uning buvisi
Bir kuni Sardor buvisidan yoshini so'radi, keyin Sardor o’ylab qoldi: "men necha yildan so'ng buvimning yoshini teng yarmiga yetar ekanman" deb. Sardor buni hisoblay olmadi, Sardorga sizning yordamingiz kerak. Sardor sizga buvisini va o'zining yoshini aytadi, siz esa necha yildan so’ng Sardorning yoshi buvisining yoshini yarimiga teng bo’lishini topishingiz kerak
Kirish faylida 2ta butun son, n va m kiritiladi. n - Sardorning buvisining yoshi, m esa Sardorning o’zining yoshi . \((1 < n, m < 100)\)
Chiqish faylida necha yildan so'ng Sardor buvisining yoshining yarimiga yetishini, buning imkoni bo'lmasa -1 deb chop eting
# | input.txt | output.txt |
---|---|---|
1 |
56 18 |
20 |
2 |
38 16 |
6 |
3 |
20 46 |
-1 |
.