#include using namespace std; using ll = long long; constexpr char newl = '\n'; #define MAX 1000001 // phi[i] stores euler totient function for i // result[j] stores result for value j long long phi[MAX], result[MAX]; // Precomputation of phi[] numbers. Refer below link // for details : https://goo.gl/LUqdtY void computeTotient() { // Refer https://goo.gl/LUqdtY phi[1] = 1; for (int i=2; i> n >> m; sumOfGcdPairs(); ll ans = 0; for (int i = 0; i < m; i++) { int a; cin >> a; ans += result[a] - result[a - 1]; } cout << ans << newl; return 0; }