#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c> n; vll a(n);get(a); ll ans = (1LL< candi; for(ll i=0;inum&&e.first%num==0) tmp -= e.second; candi[num] = tmp; ans -= tmp; } std::cout << ans << '\n'; }