package  {
	
	public class Twonumer {

        public var MaxDivisor:int=1;
		public var MinMultiple:int=1;

		public function Twonumer(n1:int,n2:int):void {
			// constructor code
			MaxDivisor = calcMaxDivisor(n1,n2);
			MinMultiple = calcMinMultiple(n1,n2);
		}
		
		private function  calcMaxDivisor(m1:int,m2:int):int {
			
			var n,m,r,temp:int;  

            n=m1;
			m=m2;
			
            if  (n<m)    {                    //把大数放在n中,把小数放在m中. 
                temp=n; 
                n=m; 
                m=temp; 
             }  
           
            while(m!=0)  {         //求两个数n,m的最大公约数. 
                 r=n%m; 
                 n=m; 
                  m=r; 
           } 
			return n;			
		}
		
		private function  calcMinMultiple(m1:int,m2:int):int  {
			var n,m,r,p:int;
			
			n=m1;
			m=m2;
			
			r=calcMaxDivisor(n,m);
			p=n*m;
			
			return p/r;			
		}

	}
	
}
