http://acm.hit.edu.cn/hoj/problem/view?id=2769
计算每组占的面积
#include <stdio.h>
#include <math.h>
int main()
{
int n, i, s, r, sum;
int a, b, c;
scanf("%d", &n);
while (n--)
{
sum = 0;
scanf("%d", &i);
while (i--)
{
scanf("%d %d", &s, &r);
sum += s * r;
}
a = floor(1296 / sum);
b = floor(2592 / sum);
c = floor(3888 / sum);
printf("%d %d %d\n", a, b, c);
}
return 0;
}