View Code of Problem 59

#include "stdio.h"
int main()
{
	int a,b,t,i;
	scanf("%d%d",&a,&b);
	t=a*b;
	if(a>=2&&b>=2)
	for(i=2;i<t/2;i++)
	{
		if(t%i==0)
		{
          printf("%d %d",t/i,i);
		  break;
		}
	}
	if(a==1&&b>1)
		printf("%d %d",b,a);
	if(a>1&&b==1)
		printf("%d %d",a,b);
	return 0;
}

Double click to view unformatted code.


Back to problem 59