Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
361 B
0
Indexable
Never
#include <fstream>
#include <iostream>
#include <string>
using namespace std;	
float v(float a, float b) {
	float p;
	p = 4 * ((3.14 * a * b + (a - b) * (a - b) )/ (a + b));
	return p;
}
int main()
{
	float a, b, p,n;
	ifstream in("input.txt");
	in >> n;
	for (int i = 0; i < n; i++)
	{
		in >> a;
		in >> b;
		cout<< v(a, b)<<endl;
		
	}
}