stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<iostream>

using namespace std;

	int main(){

		int n;

		cin>>n;

		n%=10;

		if(n==3)

			cout<<"bon\n";

		else if(n==0||n==1||n==6||n==8)

			cout<<"pon\n";

		else

			cout<<"hon\n";

	}

// Faster C++ solution for the same problem (measured speedup: 5.3065007654656995x):
#include <stdio.h>

int main()

{

          int x,a;

          scanf("%d",&x);

          a=x%10;

          if (a==2||a==4||a==5||a==7||a==9)

                    printf("hon\n");

          else if(a==0||a==1||a==6||a==8)

                    printf("pon\n");

          else

                    printf("bon\n");

          return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main()

{

    int n;

    cin>>n;

    if(n%10==2||n%10==4||n%10==5||n%10==7||n%10==9)cout<<"hon";

    else if(n%10==0||n%10==1||n%10==6||n%10==8)cout<<"pon";

    else

    cout<<"bon";





    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.305752328008196x):
#include <stdio.h>

int main()

{

          int x,a;

          scanf("%d",&x);

          a=x%10;

          if (a==2||a==4||a==5||a==7||a==9)

                    printf("hon\n");

          else if(a==0||a==1||a==6||a==8)

                    printf("pon\n");

          else

                    printf("bon\n");

          return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int main()

{

	int n;cin>>n;

	n%=10;

	if(n==2||n==4||n==5||n==7||n==9)cout<<"hon"<<endl;

	else if(n==0||n==1||n==6||n==8)cout<<"pon"<<endl;

	else cout<<"bon"<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.316346891591353x):
#include <stdio.h>

int main()

{

          int x,a;

          scanf("%d",&x);

          a=x%10;

          if (a==2||a==4||a==5||a==7||a==9)

                    printf("hon\n");

          else if(a==0||a==1||a==6||a==8)

                    printf("pon\n");

          else

                    printf("bon\n");

          return 0;

}
// Slower C++ solution:
#include<iostream>



using namespace std;



int main(){

    int n;

    while(cin>>n){

        n %= 10;

        if(n==2||n==4||n==5||n==7||n==9){

            cout << "hon" << endl;

        }

        else if(n==0||n==1||n==6||n==8){

            cout << "pon" << endl;

        }

        else if(n==3){

            cout << "bon" << endl;

        }

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.32269107476776x):
#include <stdio.h>

int main()

{

          int x,a;

          scanf("%d",&x);

          a=x%10;

          if (a==2||a==4||a==5||a==7||a==9)

                    printf("hon\n");

          else if(a==0||a==1||a==6||a==8)

                    printf("pon\n");

          else

                    printf("bon\n");

          return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

	int n;

	cin>>n;

	int m=n%10;

	if(m==3)

	cout<<"bon";

	else if(m==0||m==1||m==6||m==8)

	cout<<"pon";

	else

	cout<<"hon";

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.306500974218228x):
#include <stdio.h>

int main()

{

          int x,a;

          scanf("%d",&x);

          a=x%10;

          if (a==2||a==4||a==5||a==7||a==9)

                    printf("hon\n");

          else if(a==0||a==1||a==6||a==8)

                    printf("pon\n");

          else

                    printf("bon\n");

          return 0;

}
// Slower C++ solution:


#include<iostream> 



using namespace std;



int main()

{

	int a;

	cin>>a;

	int ans=a%10;

	if(ans==3)

	{

		cout<<"bon"<<endl;

	}

	else if(ans==0||ans==1||ans==6||ans==8)

	{

		cout<<"pon"<<endl;

	}

	else

	{

		cout<<"hon"<<endl;

	}



return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.31599776789868x):
#include <stdio.h>

int main()

{

          int x,a;

          scanf("%d",&x);

          a=x%10;

          if (a==2||a==4||a==5||a==7||a==9)

                    printf("hon\n");

          else if(a==0||a==1||a==6||a==8)

                    printf("pon\n");

          else

                    printf("bon\n");

          return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;



void solve()

{

    ll n,a,i;

    cin >> n;

    a=n%10;

    if(a==2 || a==4 || a==5 || a==7 || a==9)cout << "hon";

    else if(a==0 || a==1 || a==6 || a==8)cout << "pon";

    else cout << "bon";

}



int main()

{

    ll t,i;

    solve();



    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.2979251519599115x):
#include <stdio.h>

int main()

{

          int x,a;

          scanf("%d",&x);

          a=x%10;

          if (a==2||a==4||a==5||a==7||a==9)

                    printf("hon\n");

          else if(a==0||a==1||a==6||a==8)

                    printf("pon\n");

          else

                    printf("bon\n");

          return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cmath>

#include<iomanip>

#include<algorithm>

#include<string.h>

using namespace std;

typedef long long ll;

int main()

{

	int n;

	cin>>n;

	int t=n%10;

	if(t==2||t==4||t==5||t==7||t==9)

	cout<<"hon";

	else if(t==3)

	cout<<"bon";

	else

	cout<<"pon";

}

// Faster C++ solution for the same problem (measured speedup: 5.3073873748655185x):
#include <stdio.h>

int main()

{

    int N;

    scanf("%d",&N);

    if((N%10==2)||(N%10==4)||(N%10==5)||(N%10==7)||(N%10==9))

    {

        printf("hon\n");

    }

    else if((N%10==0)||(N%10==1)||(N%10==6)||(N%10==8))

    {

        printf("pon\n");

    }

    else if(N%10==3)

    {

        printf("bon\n");

    }

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main()

{

	string a;

	cin>>a;

	int temp=a[a.length()-1]-'0';

	if (temp==2||temp==4||temp==5||temp==7||temp==9)

		cout<<"hon";

	else if (temp==3)

		cout<<"bon";

	else

		cout<<"pon";

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.339409021344931x):
#include <stdio.h>

int main()

{

    int N;

    scanf("%d",&N);

    if((N%10==2)||(N%10==4)||(N%10==5)||(N%10==7)||(N%10==9))

    {

        printf("hon\n");

    }

    else if((N%10==0)||(N%10==1)||(N%10==6)||(N%10==8))

    {

        printf("pon\n");

    }

    else if(N%10==3)

    {

        printf("bon\n");

    }

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

	int n,a;

	cin>>n;

	a=n%10;

	if(a==2||a==4||a==5||a==7||a==9) cout<<"hon"<<endl;

	else if(a==0||a==1||a==6||a==8) cout<<"pon"<<endl;

	else if(a==3) cout<<"bon"<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.317221022026174x):
#include <stdio.h>

int main()

{

    int N;

    scanf("%d",&N);

    if((N%10==2)||(N%10==4)||(N%10==5)||(N%10==7)||(N%10==9))

    {

        printf("hon\n");

    }

    else if((N%10==0)||(N%10==1)||(N%10==6)||(N%10==8))

    {

        printf("pon\n");

    }

    else if(N%10==3)

    {

        printf("bon\n");

    }

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

    long long n;

    cin>>n;

    if(n%10==2||n%10==4||n%10==5||n%10==7||n%10==9)

        cout<<"hon";

    else if(n%10==0||n%10==1||n%10==6||n%10==8)

        cout<<"pon";

    else cout<<"bon";

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.304047164473455x):
#include <stdio.h>

int main()

{

    int N;

    scanf("%d",&N);

    if((N%10==2)||(N%10==4)||(N%10==5)||(N%10==7)||(N%10==9))

    {

        printf("hon\n");

    }

    else if((N%10==0)||(N%10==1)||(N%10==6)||(N%10==8))

    {

        printf("pon\n");

    }

    else if(N%10==3)

    {

        printf("bon\n");

    }

}
// Slower C++ solution:
#include<iostream>

using namespace std;



int main()

{

	int n;

	while(cin>>n)

	{

		int ans=n%10;

		if(ans==2||ans==4||ans==5||ans==7||ans==9)

		cout<<"hon"<<endl;

		else if(ans==0||ans==1||ans==6||ans==8)

		cout<<"pon"<<endl;

		else

		cout<<"bon"<<endl;

	}

	

return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.323602280316152x):
#include <stdio.h>

int main()

{

    int N;

    scanf("%d",&N);

    if((N%10==2)||(N%10==4)||(N%10==5)||(N%10==7)||(N%10==9))

    {

        printf("hon\n");

    }

    else if((N%10==0)||(N%10==1)||(N%10==6)||(N%10==8))

    {

        printf("pon\n");

    }

    else if(N%10==3)

    {

        printf("bon\n");

    }

}
// Slower C++ solution:
#include<stdio.h>

#include<math.h>

#include<algorithm>

#include<iostream>

#include<cstring> 

#include<cstdlib>

#include<set>

#include<vector>

using namespace std;

#define ll long long

const int maxn = 2e5 + 5;

const int inf =9999999;



int main()

{     int t;

	cin>>t;

     if(t%10==3)

     cout<<"bon"<<endl;

     else if(t%10==0||t%10==1||t%10==6||t%10==8)

     cout<<"pon"<<endl;

     else

     cout<<"hon"<<endl;



	

}

	 

		

	  	

	  

// Faster C++ solution for the same problem (measured speedup: 5.316885381393405x):
#include <stdio.h>

int main()

{

    int N;

    scanf("%d",&N);

    if((N%10==2)||(N%10==4)||(N%10==5)||(N%10==7)||(N%10==9))

    {

        printf("hon\n");

    }

    else if((N%10==0)||(N%10==1)||(N%10==6)||(N%10==8))

    {

        printf("pon\n");

    }

    else if(N%10==3)

    {

        printf("bon\n");

    }

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<string>

#include<iomanip>

#include<cmath>

using namespace std;



int main() {

	int n;

	cin >> n;

	n = n % 10;

	if (n == 2 || n == 4 || n == 5 || n == 7 || n == 9)cout << "hon";

	else if (n == 0 || n == 1 || n == 6 || n == 8)cout << "pon";

	else cout << "bon";

}


// Faster C++ solution for the same problem (measured speedup: 5.306554805346031x):
#include <stdio.h>

int main()

{

    int N;

    scanf("%d",&N);

    if((N%10==2)||(N%10==4)||(N%10==5)||(N%10==7)||(N%10==9))

    {

        printf("hon\n");

    }

    else if((N%10==0)||(N%10==1)||(N%10==6)||(N%10==8))

    {

        printf("pon\n");

    }

    else if(N%10==3)

    {

        printf("bon\n");

    }

}
// Slower C++ solution:
#include<iostream> 

#include<string>

#include<cstring>

#include<algorithm>

#include<stack>

#include<cmath>

#define ll long long

using namespace std;

const int N=2e5+5;

const int M=1e8;

const ll Max=1e18+1000;

ll a[N];



int main()

{

	int n;

	while(cin>>n)

	{

		int a=n%10;

		if(a==2 || a==4 || a==5 || a==7 || a==9)

		cout<<"hon"<<endl; 

		else if(a==0 || a==1 || a==6 || a==8)

		cout<<"pon"<<endl;

		else 

		cout<<"bon"<<endl;

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.324187496439429x):
#include <stdio.h>

int main()

{

    int N;

    scanf("%d",&N);

    if((N%10==2)||(N%10==4)||(N%10==5)||(N%10==7)||(N%10==9))

    {

        printf("hon\n");

    }

    else if((N%10==0)||(N%10==1)||(N%10==6)||(N%10==8))

    {

        printf("pon\n");

    }

    else if(N%10==3)

    {

        printf("bon\n");

    }

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

	int n;cin>>n;

	int x=n%10;

	if(x==2||x==4||x==5||x==7||x==9) cout<<"hon";

	else if(x==0||x==1||x==6||x==8) cout<<"pon";

	else cout<<"bon";

}

// Faster C++ solution for the same problem (measured speedup: 5.30689444276586x):
#include <stdio.h>

int main()

{

    int N;

    scanf("%d",&N);

    if((N%10==2)||(N%10==4)||(N%10==5)||(N%10==7)||(N%10==9))

    {

        printf("hon\n");

    }

    else if((N%10==0)||(N%10==1)||(N%10==6)||(N%10==8))

    {

        printf("pon\n");

    }

    else if(N%10==3)

    {

        printf("bon\n");

    }

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<cstring>

#include<iomanip>

#include<cstdio>

using namespace std;

typedef long long ll;

const ll inf=0x3f3f3f3f;

int main()

{

	int n,t;

	cin>>n;

	t=n%10;

	if(t==2||t==4||t==5||t==7||t==9)

	cout<<"hon";

	else if(t==0||t==1||t==6||t==8)

	cout<<"pon";

	else

	cout<<"bon";

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3065581012040175x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main(){

	int x, m;

	cin>>x;

	m=x%10;

	if(m==2||m==4||m==5||m==7||m==9)

	cout<<"hon";

	else if(m==0||m==1||m==6||m==8)

	cout<<"pon";

	else if(m==3)

	cout<<"bon";

}  

// Faster C++ solution for the same problem (measured speedup: 5.30654713986637x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cstdio>

using namespace std;



int main(){

	int n;

	string a[10]={"pon","pon","hon","bon","hon","hon","pon","hon","pon","hon"};

	cin>>n;

	cout<<a[n%10];

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 5.3393306515091x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

	int n;

	cin>>n;

	if(n%10==2||n%10==4||n%10==5||n%10==7||n%10==9)

	{

		cout<<"hon";

	}

	else if(n%10==0||n%10==1||n%10==6||n%10==8)

	{

		cout<<"pon";

	}

	else if(n%10==3)

	{

		cout<<"bon";

	}

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 5.306512704861436x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main(){

	int a;

	cin>>a;

	if(a%10==3)

	cout<<"bon"<<endl;

	else if(a%10==0||a%10==1||a%10==6||a%10==8)

	cout<<"pon"<<endl;

	else cout<<"hon"<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.316885381393405x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

	long long N;

	cin>>N;

	if(N%10==2||N%10==4||N%10==5||N%10==7||N%10==9)

	{

		cout<<"hon"<<endl;

	}

	else if(N%10==0||N%10==1||N%10==6||N%10==8)

	{

		cout<<"pon"<<endl;

	}

	else

	cout<<"bon"<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.317736100501895x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main() {

    int n;

    while (cin >> n) {

        while (n >= 10) {

            n %= 10;

        }

        if (n == 2 || n == 4 || n == 5 || n == 7 || n == 9)

            cout << "hon" << endl;

        else if (n == 0 || n == 1 || n == 6 || n == 8)

            cout << "pon" << endl;

        else {

            cout << "bon" << endl;

        }

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.3236248591803665x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cstring>

using namespace std;

int main(){

	string a;

	int len;

	cin>>a;

	len=a.length()-1;

	if(a[len]=='2'||a[len]=='4'||a[len]=='5'||a[len]=='7'||a[len]=='9'){

		cout<<"hon"<<endl;

	}else if(a[len]=='0'||a[len]=='1'||a[len]=='6'||a[len]=='8'){

		cout<<"pon"<<endl;

	}else if(a[len]=='3'){

		cout<<"bon"<<endl;

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.309263911130545x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;



int main()

{long long n,q,l;

 while(cin>>n)

 {if(n%10==3)

  cout<<"bon"<<endl;

  else if(n%10==0||n%10==1||n%10==6||n%10==8)

  cout<<"pon"<<endl;

  else

  cout<<"hon"<<endl;

  

 }

 return 0;

 } 

// Faster C++ solution for the same problem (measured speedup: 5.320955900227071x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main() {

	int n;

	cin>>n;

	int t=n%10;

	if(t== 2||t== 4||t==5||t== 7||t==  9) {

		cout<<"hon"<<endl;

	} else if(t==0||t==1||t== 6||t== 8) {

		cout<<"pon"<<endl;

	} else if(t==3) {

		cout<<"bon"<<endl;

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.317221022026174x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main(){

    int N, C;

    cin>>N;

    C = N % 10;

    if (C == 2 || C == 4 || C == 5 || C == 7 || C == 9){

        cout<<"hon";

    }

    else if (C == 0 || C == 1 || C == 6 || C == 8){

        cout<<"pon";

    }

    else {

        cout<<"bon";

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.3065581012040175x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int main(void)

{

    short int n;

    cin>>n;

    int one = n%10;



    if(one==3) cout<<"bon"<<endl;

    else if(one==2 || one==4 || one==5 || one==7 || one==9) cout<<"hon"<<endl;

    else cout<<"pon"<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.317471522146525x):
#include <stdio.h>



int main(){

	int num;

	scanf("%d",&num);

	if (num%10==2||num%10==4||num%10==5||num%10==7||num%10==9){

		printf("hon\n");

	}

	else if(num%10==0||num%10==1||num%10==6||num%10==8){

		printf("pon\n");

	}

	else if(num%10==3){

		printf("bon\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main(){

	int a;cin>>a;

	a=a%10;

	if(a==3) cout<<"bon";

	else if(a==2||a==4||a==5||a==7||a==9) cout<<"hon";

	else cout<<"pon";

}

// Faster C++ solution for the same problem (measured speedup: 5.30738715116475x):


#include <stdio.h>

int main(){

	int n,a;

	scanf("%d",&n);

	a=n%10;

	if(a==2||a==4||a==5||a==7||a==9)printf("hon\n");

	else if(a==0||a==1||a==6||a==8)printf("pon\n");

	else if(a==3)printf("bon\n");

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



#define MXN 20005

// #define debug



int mx[MXN], t[MXN], v[MXN], en;

double memo[MXN][105]; 

bool visited[MXN][105];

const int inf = 0x3f3f3f3f;



double dfs(int cur, int speed) {

    if (cur == en+1) {

        if (speed) return -inf;

        else return 0;

    }

    if (visited[cur][speed]) return memo[cur][speed];

    visited[cur][speed] = 1;

    double res = -inf;

    if (speed < mx[cur]) {

        res = max(res, dfs(cur+1, speed) + speed);

        res = max(res, dfs(cur+1, speed) + speed+0.25);

        res = max(res, dfs(cur+1, speed+1) + speed+0.5);

        if (speed) 

            res = max(res, dfs(cur+1, speed-1) + speed-0.5);

    } else if (speed == mx[cur]) {

        res = max(res, dfs(cur+1, speed) + speed);

        res = max(res, dfs(cur+1, speed-1) + speed-0.5);

    } 

    return memo[cur][speed] = res;

}



int main() { 

    int n;

    while (cin >> n) {

        en = 0;

        for (int i = 0; i < n; ++i) {

            cin >> t[i];

            en += t[i];

        }

        for (int i = 0; i < n; ++i) cin >> v[i];

        int cur = 1, tmp;

        for (int i = 0; i < n; ++i) {

            tmp = t[i];

            while (tmp--) {

                mx[cur++] = v[i];

            }

        }

#ifdef debug

        for (int i = 1; i <= en; ++i) {

            cout << mx[i] << " ";

        }

        cout << "\n";

#endif

        memset(visited, 0, sizeof(visited));

        printf("%.9lf\n", dfs(1, 0));

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 3.263332987183493x):
#include <iostream>

#include <cstdlib>

#include <cstdio>

#include <cstring>

#include <algorithm>

using namespace std;

#define rep(x, n) for (int x = 1; x <= n; ++x)

#define FOR(x, l, r) for (int x = l; x <= r; ++x)

const int maxN = 505;

struct T

{

	double l, r, bg;

	int a;

	double ed()

	{

		return bg + a * (r - l);

	}

	double dis()

	{

		return (bg + ed()) * (r - l) * 0.5;

	}

	void print()

	{

		cout << l << " " << r << " " << bg << " " << a << endl;

	}

}st[maxN];

int v[maxN], t[maxN], n, top;



void add(double l, double r, double bg, int a)

{

	++top;

	st[top].l = l; st[top].r = r;

	st[top].bg = bg; st[top].a = a;

}



void make(double v)

{

	if (st[top].ed() <= v) return;

	double l = st[top].l, r = st[top].r;

	double bg = st[top].bg;

	if (bg > v + (r - l))

	{

		top--;

		make(v + (r - l));

		add(l, r, v + (r - l), -1);

	}

	else

	{

		double a = st[top].a;

		double x = (v + r + l * a - bg) / (1 + a);

		st[top].r = x;

		add(x, r, v + r - x, -1);

	}

}



int main()

{

	scanf("%d", &n);

	rep(i, n) scanf("%d", t + i);

	rep(i, n) scanf("%d", v + i);



	add(-1, 0, 0, 0);



	double ti = 0;

	rep(i, n)

	{

		make(v[i]);

		double last = st[top].ed();

		if (t[i] > (v[i] - last))

		{

			add(ti, ti + v[i] - last, last, 1);

			add(ti + v[i] - last, ti + t[i], v[i], 0);

		}

		else

		{

			add(ti, ti + t[i], last, 1);

		}

		ti += t[i];

	}

	make(0.0);



	double ans = 0;

	rep(i, top) ans += st[i].dis();



	printf("%.10lf\n", ans);

	return 0;

}