暴力:从大到小遍历x,遍历到k为整数结束
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin >> n;
for(int i = 100; i >= 1; i--){
if((n / 52 - 7 * i) % 21 != 0){
continue;
}else{
k = (n / 52 - 7 * i) / 21;
}if(k <= 0){
continue;
}
cout << i <<endl;
cout << k << endl;
break;
}
return 0;
}