//这个题目要注意.学分可能是负的..以后也要注意.没有说的非负数的时候不要常规思维...
#include<stdio.h>
#include<iostream>#include<stdlib.h>
#include<math.h>
#include<string.h>
const int inf = 0x3f3f3f;
const double end = 0.01;
using namespace std;
int main()
{
int n;
double s,p;
while(scanf("%d",&n) != EOF)
{
double xuefen = 0,chengji = 0;
int vis = 0;
double ans ;
for(int i = 1 ; i <= n ; i++)
{
scanf("%lf%lf",&s,&p);
if(s < end)while(1);
if(p != -1)
{
vis = 1;
xuefen += s ;
if(p >= 90)chengji+= s*4;
else
{
if(p >= 80)chengji += s*3;
else
{
if(p >= 70)chengji += s*2;
else
{
if(p >= 60) chengji += s;
}
}
}
}
}
if(xuefen < end)printf("-1\n");
else printf("%.2lf\n",1.0 * chengji/xuefen);
}
}