/*
Problem link
Type: string process, kmp, adhoc
Algorithm:
1 /*
2 Problem link
3 Type: Complete Search
4 Algorithm:
5 Just do as it says
6 */
1 /*
2 Problem link
3 Type: Data structure - Binary index (Fenwick) tree
4 Algorithm:
1 /*
2 Problem link
3 Type: Data structure - link list
4 Algorithm:
1 /*
2 Problem link
3 Type: Adhoc - Sorting
4 Algorithm:
1 /*
2 Problem link
3 Type: Recursion - Greedy
4 Algorithm:
1 /*
2 Problem link
3 Type: Ad hoc, Greedy
4 Algorithm:
1 /*
2 Problem link
3 Type: Adhoc
4 Algorithm:
5 */
1 /*
2 Problem link
3 Type: Ad hoc, Sorting.
4 Algorithm: Insertion Sort.
5 */
/*
Problem link
Type: Adhoc - greedy, Data structure - priority queue
*/
1 #include <iostream>
2 #include <cstdio>
3 #include <cstring>
4 #include <cmath>
5 #include <vector>
6 #include <queue>
/*
Problem link
Type: Adhoc, brute-force
*/
1
#include <iostream>
2 #include <cstdio>
3 #include <cstring>
4 #include <cmath>
5 #include <cstdlib>
6 #include <vector>
7 using namespace std;
8 const int maxn = 1000010;
/*
Problem link
*/
#include <iostream>
#include <cstdio>
using namespace std;
const int n = 20;
class url {
public:
string link;
int value;
};
url a[n];
int main() {
int ntest;
string line;
cin >> ntest;
for (int test=1; test<=ntest; test++)
{
printf("Case #%d:\n",test);
for (int i=1; i<=10; i++)
{
cin >> a[i].link;
cin >> a[i].value;
}
int themax = 0;
for (int i=1; i<=n; i++) themax = a[i].value>themax ? a[i].value : themax;
for (int i =1; i<=n; i++)
if (a[i].value==themax) cout << a[i].link << endl;
}
return 0;
}
/*
Problem link
*/
#include <iostream>
#include <cstdio>
using namespace std;
const int n = 10;
int a[n];
int main() {
int ntest;
cin >> ntest;
cout << "Lumberjacks:" << endl;
for (int test=1; test<=ntest; test++)
{
for (int i=1; i<=n; i++) cin >> a[i];
int tmp = a[2]-a[1];
int i;
for (i=3; i<=n; i++)
if ((a[i]-a[i-1])*tmp<=0)
{
cout << "Unordered" << endl;
break;
}
if (i==n+1) cout << "Ordered" << endl;
}
return 0;
}
/*
Problem link
*/
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
int ntest, n;
cin >> ntest;
for (int test=1; test<=ntest; test++)
{
cin >> n;
int max = 0, value;
for (int i=1; i<=n; i++)
{
cin >> value;
if (value>max) max = value;
}
printf("Case %d: %d\n",test, max);
}
}