#include using namespace std; using ll = long long; int nmod(int a, int b){ return(((a % b) + b ) % b); } bool solve(int x, int n){ bool flag = false; if(x> n >> d; map headCandidate; map bodyCandidate; map tailCandidate; for(int i=0; i> a; headCandidate[a] += 1; bodyCandidate[a] += headCandidate[a - d]; tailCandidate[a] += bodyCandidate[a - d]; } ll count = 0; for(const auto& [key, value] : tailCandidate){ count += value; } cout << count << endl; }