-
-
Save kik/2391806 to your computer and use it in GitHub Desktop.
GCJ 2012 Qual B
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int T; | |
cin >> T; | |
for (int cas = 1; cas <= T; cas++) { | |
int N, S, p; | |
cin >> N >> S >> p; | |
int res = 0; | |
for (int i = 0; i < N; i++) { | |
int ti; | |
cin >> ti; | |
if (ti >= 3 * p) res++; | |
else if (ti >= 3 * p - 2 && p - 1 >= 0) res++; | |
else if (ti >= 3 * p - 4 && p - 2 >= 0 && S > 0) res++, S--; | |
} | |
cout << "Case #" << cas << ": " << res << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment