## GOV Chronicles

#include<stdio.h>
int n,a[14]= {5,21,12,2,1,4,6,1,4,4,1,0,1,1};
int main()
{
scanf("%d",&n);
printf("%d",a[n]);
}


## Football Goal

#include<stdio.h>
#include<math.h>
double a,b;
int main()
{
scanf("%lf%lf",&a,&b);
printf("%.9f",(a*a+b*b)/4+a*b/sqrt(2));
}


## Angry Birds

//待补题


## Centipede’s Morning

#include<stdio.h>
int a,b;
int main()
{
scanf("%d%d",&a,&b);
a=a*2+39,b=b*2+40;
printf("%d",a>b?a:b);
}


## Bicycle Codes

#include<stdio.h>
int a,b;
int main()
{
scanf("%d%d",&a,&b);
printf(a%2==0||b%2==1?"yes":"no");
}


## Rubinchik’s Cube

#include<bits/stdc++.h>
using namespace std;
int s[4],ans=1e9;
int main()
{
for(int i=0,c; i<4; ++i)
for(int j=0; j<4; ++j)
{
scanf("%d",&c);
if(c==1)
++s[i<2&&j<2?0:
i<2&&j>=2?1:
i>=2&&j>=2?2:3];
}
for(int i=0; i<4; ++i)
ans=min(ans,s[(i+1)%4]+s[(i+2)%4]*2+s[(i+3)%4]);
printf("%d",ans);
}


## GOV-internship 2

#include<bits/stdc++.h>
using namespace std;
const int N=100009;
typedef long long ll;
ll n[2],v[2][N];
int main()
{
for(int j=0,t; j<2; ++j)
{
scanf("%lld",&n[j]);
for(int i=0; i<n[j]; ++i)
scanf("%d",&t),++v[j][t];
}
ll tmp=n[0]*n[1];
for(int i=1; i<N; ++i)
tmp-=v[0][i]*v[1][i];
ll ans=tmp-v[0][0]**max_element(v[1]+1,v[1]+N)-v[1][0]**max_element(v[0]+1,v[0]+N);
for(int i=1; i<N; ++i)
ans=min(ans,tmp-v[0][0]*v[1][i]-v[1][0]*v[0][i]-v[0][0]*v[1][0]);
printf("%lld",ans);
}


## Psych Up’s Eigenvalues

#include<bits/stdc++.h>
using namespace std;
int a[16383],siz=0,ans=0;
int main()
{
for(int i=0,n; i<3; ++i)
for(scanf("%d",&n); n--;)
scanf("%d",&a[siz++]);
sort(a,a+siz);
for(int i=2; i<siz; ++i)
if(a[i-2]==a[i]&&a[i-1]==a[i])
++ans;
printf("%d",ans);
}


## Long problem statement

#include<bits/stdc++.h>
using namespace std;
string s;
int h,w,n,r=1,c=0;
int main()
{
for(cin>>h>>w>>n; n--;)
{
cin>>s;
if(c+s.size()+1<w)c+=s.size()+1;
else if(c+s.size()<=w&&w<=c+s.size()+1)c=0,++r;
else c=s.size()+1,++r;
}
if(!c)--r;
printf("%d",r/h+(r%h?1:0));
}


## Old Nokia

//待补


## Ent’s Birthday

#include<bits/stdc++.h>
#define X first
#define Y second
using namespace std;
const int INF=1e9;
typedef pair<int,int> Coord;
int main()
{
int n,k;
scanf("%d%d",&n,&k);
vector<Coord> p(n),ans;
for(int i=0,x,y; i<n; ++i)
scanf("%d%d",&p[i].X,&p[i].Y);
sort(p.begin(),p.end());
ans.push_back(p[k-1]);
if(p[k-1].X-1!=-INF)ans.push_back(Coord(p[k-1].X-1,INF));
ans.push_back(Coord(-INF,INF));
ans.push_back(Coord(-INF,-INF));
ans.push_back(Coord(p[k-1].X,-INF));
printf("%d\n",ans.size());
for(int i=0; i<ans.size(); ++i)
printf("%d %d\n",ans[i].X,ans[i].Y);
}


## Way to the University

#include<bits/stdc++.h>
using namespace std;
int n,d,v[16383];
int main()
{
for(scanf("%d",&n); n--;)
scanf("%d",&d),fill(v+d+8,v+d+5+8,1);//8==20/5*2
for(scanf("%d",&n); n--;)
scanf("%d",&d),fill(v+d,v+d+5,1);
for(int i=0;; ++i)
if(*max_element(v+i+8,v+i+8+8)==0)
return printf("%.6f",i*0.18),0;//0.18==3600/20000
}