#include #define rep(i,n) for(int i = 0;i> k; int ans = 0; int digits[] = {1,2,3,4,5,6,7,8}; do{ ll n = to_num(digits); if(n % k == 0) ans++; }while(next_permutation(digits, digits+8)); cout << ans << endl; return 0; }