Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
423 B
1
Indexable
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <iomanip>
using namespace std;
float func(float b,float c) {
	return 4 * ((3.1415926535 * b * c + (b+c)*(b+c))/(b+c));
}
int main(){
	ifstream in("input.txt");
	ofstream out("result.txt");
	out << setprecision(2);
	float a, b, c;
	in >> a;
	for (int i = 0; i < a; i++) {
		in >> b >> c;
		out << func(b, c) << '\n';
	}
}