# Hartals 題目連結 [UVA 10050](https://onlinejudge.org/external/100/10050.pdf) ## 中文簡述 ## [think] ## solution: ``` #include <bits/stdc++.h> using namespace std; int main() { int T,N,P,h[101]i,j; cin>>T; while (T--) { cin>>N>>P; for (i=0; i<P; i++) { cin>>h[i]; } int hartal=0; for (i=1; i<=N; i++)\ { if (i%7 == 6) { i++; continue; } for (j=0; j<P; j++) { if (i%h[j] == 0) { hartal++; break; } } } cout<<hartal<<endl; } return 0; } ``` ###### tags: `UVA` 回目錄 [學習筆記](/gIBZqAbWTCis7uOPp149gA)
{"metaMigratedAt":"2023-06-16T04:45:43.554Z","metaMigratedFrom":"Content","title":"Hartals","breaks":true,"contributors":"[{\"id\":\"d1163905-4b7c-4c05-8592-57a1bbd6b1fd\",\"add\":807,\"del\":0}]"}
    291 views
   Owned this note