sicily 1636

#include <iostream> using namespace std; int main() { int T, m, n; cin >> T; while(T--) { cin >> m >> n; int used = 0; for(int i = 0; i < n; i++) { int a, b; cin >> a >> b; used += a * b; } if(m - used >= 0) cout << m - used << endl; else cout << "Not enough" << endl; } return 0; } 

你可能感兴趣的:(include)