哈哈。考想法的一道题。
首先注意到这句话:You may assume both families were cleaning at the same speed.
所以按理来说,(样例1中)本应该周末每个家庭都花3小时来清理花园,但A在忙完自己的一部分后又帮了C2小时,B帮了C1小时所以A要得90*2/(2+1)=60美刀
完整代码:
/*0.019s*/
#include<cstdio>
int main()
{
int t, a, b, m;
scanf("%d", &t);
while (t--)
{
scanf("%d%d%d", &a, &b, &m);
printf("%d\n", m * (2 * a - b) / (a + b));
}
return 0;
}