Submission #917987

#TimeUsernameProblemLanguageResultExecution timeMemory
917987borisAngelovKitchen (BOI19_kitchen)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; int n, m, k; void fastIO() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } int main() { fastIO(); cin >> n >> m >> k; int sumA = 0; bool found = false; for (int i = 1; i <= n; ++i) { int x; cin >> x; sumA += x; if (x < k) { found = true; } } int sumB = 0; for (int i = 1; i <= m; ++i) { int x; cin >> x; sumB += x; } if (found == true || k > n || sumA > sumB || sumB < n * k) { cout << "Impossible" << endl; } else { cout << sumB - sumA << endl; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...