HPU 1718: Thanksgiving KK Session--KK and female tickets walk the dog water together

Source: Internet
Author: User
Tags time limit ticket
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;
 


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.