def rozklad(wej):
wyj = dict()
i = 2
while wej != 1:
if wej % i == 0:
wyj[i] = wyj.get(i, 0) + 1
wej //= i
else:
i += 1
return wyj
def potega(wej):
wynik, i = 0, 1
while i < wej:
i *= 2
wynik += 1
return i, wynik
def main(wej):
if wej == 1:
print(1, 0)
return
dziel = rozklad(wej)
maks, wynik = potega(max(dziel.values()))
for i in dziel.values():
if i != maks:
wynik += 1
break
liczba = 1
for i in dziel:
liczba *= i
print(liczba, wynik)
main(int(input()))
#include<bits/stdc++.h>
#define lb long long
#define ulb unsigned long long int
using namespace std;
void solve();
int M=1e9+7;
lb inf=1e17;
bitset<500001> Pri;
vector<lb>primes;
void Sieve(lb n)
{
Pri[0] = 1;
for (int i = 3; i*i <= n; i += 2) {
if (Pri[i / 2] == 0) {
for (int j = 3 * i; j <= n; j += 2 * i)
Pri[j / 2] = 1;
}
}
for (int i = 1; i <= n; i++) {
if (i == 2)
primes.push_back(i);
else if (i % 2 == 1 && Pri[i / 2] == 0)
primes.push_back(i);
}
}
bool is_prime(lb n)
{
for(int i=2;i*i<=n;i++)
{
if(n%i==0)
return false;
}
return true;
}
/*vector<lb>pf(15000006,0),mp(15000006,0);
lb N=15000006;
pf[1]=1;
for(int i=2;i<=15000000;i++)if(!pf[i])
for(int j=i;j<=15000000;j+=i)
if(!pf[j])
pf[j]=i;*/
//11<<2 -> 1100; -> use 1LL << 2 if taking long long
lb count_setbit(lb n)
{
return __builtin_popcountll(n);
//rember ctz and clz
// a=__builtin_clzll(l);
//b=__builtin_clzll(r);
}
bool is_set(lb n,lb i)
{
n=n>>i;
if(n%2)
return true;
return false;
}
void solve( int pp)
{
lb i,n;cin>>n;
map<lb,lb>mp;
for(i=2;i<=n;i++)
{
while(n%i==0)
{
mp[i]++;
n=n/i;
}
}
lb ans=1,ma=0,ct=0;
for(auto x:mp)
{
ans=ans*x.first;
ma=max(ma,x.second);
}
for(i=1;i<ma;i=i*2){ct++;}
for(auto x:mp)
{
if(x.second!=i){
ct++;break;
}
}
cout<<ans<<" "<<ct;
}
int main()
{
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
int t;
// cin>>t;
t=1;
int shiv=ceil(sqrt(1000002));
// Sieve(100);
int g=0;
while(t--)
{
g++;
solve(g);
}
}
1451A - Subtract or Divide | 1B - Spreadsheet |
1177A - Digits Sequence (Easy Edition) | 1579A - Casimir's String Solitaire |
287B - Pipeline | 510A - Fox And Snake |
1520B - Ordinary Numbers | 1624A - Plus One on the Subset |
350A - TL | 1487A - Arena |
1520D - Same Differences | 376A - Lever |
1305A - Kuroni and the Gifts | 1609A - Divide and Multiply |
149B - Martian Clock | 205A - Little Elephant and Rozdil |
1609B - William the Vigilant | 978B - File Name |
1426B - Symmetric Matrix | 732B - Cormen --- The Best Friend Of a Man |
1369A - FashionabLee | 1474B - Different Divisors |
1632B - Roof Construction | 388A - Fox and Box Accumulation |
451A - Game With Sticks | 768A - Oath of the Night's Watch |
156C - Cipher | 545D - Queue |
459B - Pashmak and Flowers | 1538A - Stone Game |