12502

/**********12502**********/
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <math.h>

#define lld long long

using namespace std;


int main()
{
	int t;//a= 2/15 b=1/12

	double x,y,z;
	double extra,avg;
	cin>>t;

	while(t--)
	{
		cin>>x>>y>>z;

		avg=(x+y)/3;

		extra = x-avg;
		printf("%.0lf\n",(extra*z)/avg);
	}

	return 0;
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *