There is a game called “I Wanna Be the Guy”, consisting of n levels. Little X and his friend Little Y are addicted to the game. Each of them wants to pass the whole game.
Little X can pass only p levels of the game. And Little Y can pass only q levels of the game. You are given the indices of levels Little X can pass and the indices of levels Little Y can pass. Will Little X and Little Y pass the whole game, if they cooperate each other?
Input
The first line contains a single integer n (1 ≤ n ≤ 100).
The next line contains an integer p (0 ≤ p ≤ n) at first, then follows p distinct integers a1, a2, …, ap (1 ≤ ai ≤ n). These integers denote the indices of levels Little X can pass. The next line contains the levels Little Y can pass in the same format. It’s assumed that levels are numbered from 1 to n.
Output
If they can pass all the levels, print “I become the guy.”. If it’s impossible, print “Oh, my keyboard!” (without the quotes).
Examples
Input
4
3 1 2 3
2 2 4
Output
I become the guy.
Input
4
3 1 2 3
2 2 3
Output
Oh, my keyboard!
Note
In the first sample, Little X can pass levels [1 2 3], and Little Y can pass level [2 4], so they can pass all the levels both.
In the second sample, no one can pass level 4.
问题链接:http://codeforces.com/problemset/problem/469/A
问题简述:输入n代表共有n个关卡,而后一行先输入x代表X能过x个关卡,后面输入X能过的关卡,下一行输入一个数y代表Y能过y个关卡,后面输入Y能过的关卡
问题分析:一个循环暴力搜索,合并两个人能过的关卡在一个数组里,如果没有能从这个数组找到第i个数就停止搜索。
AC通过的C++语言程序如下:
#include<iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int p, q;
cin >> p;
int *p1 = new int[p];
for (int i = 0; i < p; i++)
{
cin >> p1[i];
}
cin >> q;
int *q1 = new int[q];
for (int i = 0; i < q; i++)
{
cin >> q1[i];
}
int *hec = new int[q + p];
int u = p;
for (int i = 0; i < p; i++)
{
hec[i] = p1[i];
}
for (int i = 0; i < q; i++)
{
hec[u] = q1[i];
u++;
}
int lf = n;
for (int i = 0; i < n; i++)
{
int flag = 0;
for (int j = 0; j < q + p; j++)
{
if (i + 1 == hec[j]) { flag++; }
}
if (flag == 0)
{
break;
}
lf--;
}
if (lf == 0) { cout << "I become the guy."; }
else { cout << "Oh, my keyboard!"; }
return 0;
}