1718: Thanksgiving KK Session--KK and women's tickets walk the dog time limit: 1 Sec memory limit: MB
Submissions: 7 Resolution: 5
Submitted State [Discussion Version]
Title Description by sending gifts, KK Seniors successfully obtain a female ticket, female ticket to raise a lovely Tibetan mastiff, one day, KK and female ticket call about meet, KK and female ticket at this time apart s meters, two agreed to take the same route, opposite (face to face) and line, at the same time, KK to 2m/ s speed, female votes to 1m/s speed, at this time, the Tibetan mastiff to V (M/s) at the speed of the female ticket to the direction of KK Seniors, when the Tibetan mastiff saw KK seniors, and the same speed to the female ticket direction run, see female votes, once again run to KK seniors, so reciprocating, until the KK seniors and female votes meet, The Tibetan mastiff at this time altogether ran how many meters.
input
Given an integer t (1<=t<=1000), indicates that there is a T group of test data. Each test data has two integers s (0<s<10^8) and V (0<v<10^6), respectively, representing the distance between KK and female votes and the speed of the Tibetan mastiff.
Output
Each set of test data output occupies a row, each row output Tibetan mastiff running distance. The result retains two decimal places. Sample Input 548 8 sample output 50.00128.00 idea: No matter how fast the dog is, the dog's running time is certain ~ ac-code:
#include <cstdio>
int main ()
{
int t,flag;
float ans,s,t,v;
scanf ("%d", &t);
while (t--)
{
scanf ("%f%f", &s,&v);
T=S*1.0/3;
printf ("%.2f\n", t*v);
}
return 0;