https://ac.nowcoder.com/acm/contest/371#question
A.小睿睿的等式
#include <bits/stdc++.h> using namespace std; int N, K, M; int num[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6}; int rec(int x) { int res = 0; while(x) { res += num[x % 10]; x /= 10; } return res; } int main() { scanf("%d%d", &N, &K); M = N / K; M = M - 4 - rec(N); int ans = 0; for(int i = 1; i <= N / 2; i ++) { int a = rec(i); int b = rec(N - i); if(a + b == M) ans ++; } printf("%d ", ans); return 0; }