Piotr’s Ants
来源:UVA
标签:
参考资料:
相似题目:
题目
Piotr likes playing with ants. He has n of them on a horizontal pole L cm long. Each ant is facing either left or right and walks at a constant speed of 1 cm/s. When two ants bump into each other, they both turn around (instantaneously) and start walking in opposite directions. Piotr knows where each of the ants starts and which direction it is facing and wants to calculate where the ants will end up T seconds from now.
输入
The first line of input gives the number of cases, N. N test cases follow. Each one starts with a