#include <iostream> #include <vector> using namespace std; int main(){ int n, c; while(cin >> c >> n){ int i(0), j, p, v, maxv(0); vector<int> dp(c+1); for (; i < n && cin >> p >> v; ++i) for (j ...