void factorize(int n) { while(n>1){ int tot = 0, pf = sp[n]; while(n%pf==0) n/=pf, tot++; freq[maap[pf]][tot]++; } }