-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatchMaking.cpp
54 lines (45 loc) · 1013 Bytes
/
matchMaking.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <climits>
#include <functional>
#include <iomanip>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
ifstream fin("matchMaking.in");
ofstream fout("matchMaking.out");
int main()
{
int test = 0;
while (true)
{
++test;
int b = 0, s = 0, minAge = INT_MAX;
fin >> b >> s;
if (b == 0)
{
break;
}
for (int i = 0; i <= b - 1; ++i)
{
int in; fin >> in;
minAge = min(minAge, in);
}
for (int i = 0; i <= s - 1; ++i)
{
int useless; fin >> useless;
}
if (b <= s)
{
fout << "Case " << test << ": 0\n";
continue;
}
fout << "Case " << test << ": " << b - s << ' ' << minAge << '\n';
}
return 0;
}