hdu1202
/**/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <stack>
#include <queue>
typedef long long LL;
using namespace std;
int n;
int judge(double x){
if(x >= 90){
return 4;
}else if(x >= 80){
return 3;
}else if(x >= 70){
return 2;
}else if(x >= 60){
return 1;
}else{
return 0;
}
}
int main()
{
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
while(scanf("%d", &n) == 1){
double score, p;
double ans = 0, sum = 0;
for (int i = 1; i <= n; i++){
scanf("%lf %lf", &p, &score);
if(score == -1) continue;
ans += p * judge(score);
sum += p;
}
if(ans == 0){
printf("-1\n");
}else{
printf("%.2lf\n", ans / sum);
}
}
return 0;
}
/**/