#Python 2 - (削除) 254 (削除ここまで)(削除) 252 (削除ここまで)(削除) 196 (削除ここまで)(削除) 185 (削除ここまで)(削除) 156 (削除ここまで)(削除) 151 (削除ここまで)(削除) 134 (削除ここまで)(削除) 126 (削除ここまで) 121
Python 2 - (削除) 254 (削除ここまで)(削除) 252 (削除ここまで)(削除) 196 (削除ここまで)(削除) 185 (削除ここまで)(削除) 156 (削除ここまで)(削除) 151 (削除ここまで)(削除) 134 (削除ここまで)(削除) 126 (削除ここまで) 121
i=1
a,b=map(int,raw_input().split())
while b:a,b=b,a%b
while~-a:
i+=1;j=0
while a%i<1:j+=1;a/=i
if j:print`i`+'^'+`j`,
Interpreter
Example Input - stdin
100 50
Example Output - stdout
2^1 5^2
#Python 2 - (削除) 254 (削除ここまで)(削除) 252 (削除ここまで)(削除) 196 (削除ここまで)(削除) 185 (削除ここまで)(削除) 156 (削除ここまで)(削除) 151 (削除ここまで)(削除) 134 (削除ここまで)(削除) 126 (削除ここまで) 121
i=1
a,b=map(int,raw_input().split())
while b:a,b=b,a%b
while~-a:
i+=1;j=0
while a%i<1:j+=1;a/=i
if j:print`i`+'^'+`j`,
Interpreter
Example Input - stdin
100 50
Example Output - stdout
2^1 5^2
Python 2 - (削除) 254 (削除ここまで)(削除) 252 (削除ここまで)(削除) 196 (削除ここまで)(削除) 185 (削除ここまで)(削除) 156 (削除ここまで)(削除) 151 (削除ここまで)(削除) 134 (削除ここまで)(削除) 126 (削除ここまで) 121
i=1
a,b=map(int,raw_input().split())
while b:a,b=b,a%b
while~-a:
i+=1;j=0
while a%i<1:j+=1;a/=i
if j:print`i`+'^'+`j`,
Interpreter
Example Input - stdin
100 50
Example Output - stdout
2^1 5^2
#Python 2 - (削除) 254 (削除ここまで) (削除) 252 (削除ここまで) (削除) 196 (削除ここまで) (削除) 185 (削除ここまで) (削除) 156 (削除ここまで) (削除) 151 (削除ここまで) (削除) 134 (削除ここまで) 126(削除) 126 (削除ここまで) 121
f=''
i=1
a,b=map(int,raw_input().split())
while b:a,b=b,a%b
while~-a:
i+=1;j=0
while a%i<1:j+=1;a/=i
if j:print`i`+'^'+`j`,
Interpreter
Example Input - stdin
100 50
Example Output - stdout
2^1 5^2
#Python 2 - (削除) 254 (削除ここまで) (削除) 252 (削除ここまで) (削除) 196 (削除ここまで) (削除) 185 (削除ここまで) (削除) 156 (削除ここまで) (削除) 151 (削除ここまで) (削除) 134 (削除ここまで) 126
f=''
i=1
a,b=map(int,raw_input().split())
while b:a,b=b,a%b
while~-a:
i+=1;j=0
while a%i<1:j+=1;a/=i
if j:print`i`+'^'+`j`,
Interpreter
Example Input - stdin
100 50
Example Output - stdout
2^1 5^2
#Python 2 - (削除) 254 (削除ここまで) (削除) 252 (削除ここまで) (削除) 196 (削除ここまで) (削除) 185 (削除ここまで) (削除) 156 (削除ここまで) (削除) 151 (削除ここまで) (削除) 134 (削除ここまで) (削除) 126 (削除ここまで) 121
i=1
a,b=map(int,raw_input().split())
while b:a,b=b,a%b
while~-a:
i+=1;j=0
while a%i<1:j+=1;a/=i
if j:print`i`+'^'+`j`,
Interpreter
Example Input - stdin
100 50
Example Output - stdout
2^1 5^2
#Python 2 - (削除) 254 (削除ここまで) (削除) 252 (削除ここまで) (削除) 196 (削除ここまで) (削除) 185 (削除ここまで) (削除) 156 (削除ここまで) (削除) 151 (削除ここまで) 134(削除) 134 (削除ここまで) 126
f=''
i=1
a,b=map(int,raw_input().split())
while b:a,b=b,a%b
while~-a:
i+=1;j=0
while a%i<1:j+=1;a/=i
if j:f+='%d^%d '%(iprint`i`+'^'+`j`,j)
print f
Tested with Interpreter
repl.it .
Example Input (from stdin)Example Input - stdin
100 50
Example OutputExample Output - stdout
2^1 5^2
#Python 2 - (削除) 254 (削除ここまで) (削除) 252 (削除ここまで) (削除) 196 (削除ここまで) (削除) 185 (削除ここまで) (削除) 156 (削除ここまで) (削除) 151 (削除ここまで) 134
f=''
i=1
a,b=map(int,raw_input().split())
while b:a,b=b,a%b
while~-a:
i+=1;j=0
while a%i<1:j+=1;a/=i
if j:f+='%d^%d '%(i,j)
print f
Tested with repl.it .
Example Input (from stdin)
100 50
Example Output
2^1 5^2
#Python 2 - (削除) 254 (削除ここまで) (削除) 252 (削除ここまで) (削除) 196 (削除ここまで) (削除) 185 (削除ここまで) (削除) 156 (削除ここまで) (削除) 151 (削除ここまで) (削除) 134 (削除ここまで) 126
f=''
i=1
a,b=map(int,raw_input().split())
while b:a,b=b,a%b
while~-a:
i+=1;j=0
while a%i<1:j+=1;a/=i
if j:print`i`+'^'+`j`,
Interpreter
Example Input - stdin
100 50
Example Output - stdout
2^1 5^2