frogv plz explain!

Each of the next P lines contains two
integers A and B denoting the numbers of
frogs according to the input.

Please read the problem statement carefully.