#include <iostream>
#include <stdlib.h>
using namespace std;
void swap(double * a, double* b) 
{ 
    double t = *a; 
    *a = *b; 
    *b = t; 
} 
   
int partition (double arr[], int low, int high,double arr2[]) 
{ 
    int pivot = arr[high];   
    int i = (low - 1);   
  
    for (int j = low; j <= high- 1; j++) 
    { 
         
        if (arr[j] <= pivot) 
        { 
            i++;     
            swap(&arr[i], &arr[j]); 
            swap(&arr2[i],&arr2[j]); 
		} 
    } 
    swap(&arr[i + 1], &arr[high]); 
    swap(&arr2[i + 1], &arr2[high]);
    return (i + 1); 
} 
  

void quickSort(double arr[], int low, int high , double arr2[]) 
{ 
    if (low < high) 
    { 
        int pi = partition(arr, low, high,arr2); 
  
        quickSort(arr, low, pi - 1,arr2); 
        quickSort(arr, pi + 1, high,arr2); 
    } 
} 


int main(){
int n;
double z=0.0,z2=0.0,p=0.0;
cin>>n;
double niz1[n],niz2[n];	
for(int i=0;i<n;i++){
	cin>>niz1[i];
	cin>>niz2[i];
}
 quickSort(niz2,0,n-1,niz1);
for(int i=n-1;i>=0;i--){
	z2=z2+niz1[i];
    p=(z2*niz2[i])/100.0;
    if(z<p)z=p;
	
 cout<<z2<<"  "<<niz2[i]<<" "<<(z2*niz2[i])/100.0<<endl;
 p=0.0;
}
cout<<endl;
for(int i=0;i<n;i++){
	cout<<" "<<niz1[i]<<" "<<niz2[i]<<endl;
}
printf("%.30g",z);
}