Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <cstring>#include <iostream>#include <algorithm>#include <queue>#include <stack>#include <cstdint>#include <unordered_set>using namespace std;typedef long long ll;ll q,n, m, k, t,arr[200], brr[200], res, dp[20000];int main() {ios::sync_with_stdio(false);cin >> q;while (q--) {cin >> n >> m >> k >> t;for (int i = 1; i <= m; ++i) cin >> arr[i]; // 成本for (int i = 1; i <= m; ++i) cin >> brr[i]; // k值res = 0;for (int i = 1; i <= n; ++i) {//dpmemset(dp, -1, sizeof(dp));dp[0] = 0;for (int x = 0; x <= k + 1; ++x) if(dp[x] >= 0){for (int y = 1, z; y <= m; ++y) {if (brr[y] == 0) continue;for (z = 1; x + z * brr[y] <= k + 1; ++z) {