题目地址:点击打开链接
C++代码:
#include #include #include using namespace std; int main() { int T; while(cin>>T) { while(T--) { map mii; int N,P; cin>>N>>P; int i; for(i=0;i >x; int temp=x; while(temp<=N) { if(temp%7!=6&&temp%7!=0) mii.insert(make_pair(temp,1)); temp+=x; } } cout<
>x; int temp=x; while(temp<=N) { if(temp%7!=6&&temp%7!=0) mii.insert(make_pair(temp,1)); temp+=x; } } cout<