UVA 10879
#include<iostream> using namespace std; int main() { int sum,flag=1; cin>>sum; while(sum--) { long long n,i=2; cin>>n; cout<<"Case #"<<flag++<<": "<<n<<" = "; int flag2=1; while(true) { if(n%i==0&&flag2==1) { cout<<i<<" * "<<n/i<<" = "; flag2++; i++; } if(n%i==0&&flag2==2) { cout<<i<<" * "<<n/i<<endl; break; } i++; } } return 0; }