#include <iostream>
int main ()
{
int f, T, N;
double s, c;
double up, down;
scanf( "%d", &T );
while ( T -- )
{
scanf ( "%d", &N );
up = down = f = 0;
while ( N -- )
{
scanf ( "%*s%lf%lf", &c, &s );
if ( f )
{
continue;
}
if ( s < 60 && s >= 0 )
{
f = 1;
}
up += s * c;
down += c;
}
printf( f ? "Sorry!\n" : "%.2f\n", up / down );
if ( T ) putchar ( '\n' );
}
return 0;
}
hdu2061 Treasure the new start, freshmen!
最新推荐文章于 2022-02-25 21:57:21 发布