2655Beat the Flash

2655   Beat the Flash

题目描述

        XiaoMing is a normal person. One day he suddenly got magic speed power, that his speed increases t units each day(At the very beginning, his speed is a, and t is the time counting from the day he got the power). XiaoMing wants to know when he could be as fast as the flash once was(that their speed are exactly the same). The flash’s initial speed is b, and his speed increases in the same way like XiaoMing’s. So when is the earliest day that XiaoMing could have the same speed as the Flash had once?

输入格式:

There are multiple cases. Each case contains two integers a and b(0<a,b<=10000), a and b has no certain relationship on size.(a could be bigger, smaller or equal to b).

输出格式:

         If XiaoMing could have a speed equal to the Flash had once, output the earliest day that XiaoMing achieves this goal, else if not, output -1. (The first beginning is regarded as the 0th day)

输入样例 复制
2 4
输出样例 复制
2

说明

0
7
通过提交
时空限制1000ms/64mb
题目来源数据结构实验与竞赛训练
评测方式在线评测
题目类型
难        度