Refresh your knowledge with these guides on factor trees and writing numbers as a product of prime factors. List the factors of each number. Compare the lists to find the greatest number common to ...
ll fact(ll n) { if(n==0) return 1; ll res = 1; for (ll i = 2; i <= n; i++) res = res * i; return res; } ...