#include <cstdio>

using namespace std;

typedef long long ll;

const int MAXN = 1e6 + ;

int n, q;
int cnt[MAXN];
ll a[MAXN]; template <class T>
inline void scan_d(T &ret)
{
char c;
ret = ;
while ((c = getchar()) < '' || c > '');
while (c >= '' && c <= '')
{
ret = ret * + (c - ''), c = getchar();
}
} template <class T>
inline void print_d(T x)
{
if (x > )
{
print_d(x / );
}
putchar(x % + '');
} int main()
{
scan_d(n), scan_d(q);
for (int i = ; i <= n; i++)
{
for (int j = i; j <= n; j += i)
{
cnt[j]++;
}
} int odr, x, y;
while (q--)
{
scan_d(odr);
if (odr == )
{
scan_d(x), scan_d(y);
for (int i = x, j = ; i <= n; i += x, j++)
{
a[i] += y * cnt[j];
}
}
else
{
scan_d(x);
print_d(a[x]);
putchar();
}
} return ;
}
05-23 03:04