n participants of the competition were split into m teams in some manner so that each team has at least one participant. After the competition each pair of participants from the same team became friends.

Your task is to write a program that will find the minimum and the maximum number of pairs of friends that could have formed by the end of the competition.

Input

The only line of input contains two integers n and m, separated by a single space (1 ≤ m ≤ n ≤ 109) — the number of participants and the number of teams respectively. 

Output

The only line of the output should contain two integers kmin and kmax — the minimum possible number of pairs of friends and the maximum possible number of pairs of friends respectively.

Examples

Input

5 1


Output

10 10


Input

3 2


Output

1 1


Input

6 3


Output

3 6

Note

In the first sample all the participants get into one team, so there will be exactly ten pairs of friends.

In the second sample at any possible arrangement one team will always have two participants and the other team will always have one participant. Thus, the number of pairs of friends will always be equal to one.

In the third sample minimum number of newly formed friendships can be achieved if participants were split on teams consisting of 2 people, maximum number can be achieved if participants were split on teams of 1, 1 and 4 people.

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.*;



import java.math.*;
import java.io.*;
import java.text.*;
import java.math.BigInteger;
public class Main {

	static class Interval {
		      int start;
		      int end;
		      Interval() { start = 0; end = 0; }
		      Interval(int s, int e) { start = s; end = e; }
		  }
	static class pair{
		long x;
		long y;
		public pair(long a,long b) {
			this.x=a;
			this.y=b;
		}
	}
	 public static boolean[] sieve(long n)
	    {
	        boolean[] prime = new boolean[(int)n+1];
	        Arrays.fill(prime,true);
	        prime[0] = false;
	        prime[1] = false;
	        long m = (long)Math.sqrt(n);
	        for(int i=2;i<=m;i++)
	        {
	            if(prime[i])
	            {
	                for(int k=i*i;k<=n;k+=i)
	                {
	                    prime[k] = false;
	                }
	            }
	        }
	        return prime;
	    } 
	 
	 public static boolean[] primeseive(long n) {
		 boolean prime[]=new boolean[(int)n+1];
		 
		 Arrays.fill(prime, true);
		 
		 prime[0]=false;
		 prime[1]=false;
		 
		 int m=(int) Math.sqrt(n);
		 
		 for(int i=2;i<=m;i++) {
			 if(prime[i]) {
				 
				 for(int k=i*i;k<=n;k+=i) {
					 prime[k]=false;
				 }
			 }
		 }
		 
		 return prime;
	 }
	 
	    
	    static long GCD(long a,long b)
	    {
	        if(b==0)
	        {
	            return a;
	        }
	        return GCD(b,a%b);
	    }
	 
	    
	    
	    static long gcdnik(long a,long b)
	    {
	        if(b==0)
	        {
	            return a;
	        }
	        return GCD(b,a%b);
	    }
	    
	    
	    static long CountCoPrimes(long n)
	    {
	        long res = n;
	        for(int i=2;i*i<=n;i++)
	        {
	            if(n%i==0)
	            {
	                while(n%i==0)
	                {
	                    n/=i;
	                }
	                res-=res/i;
	            }
	        }
	        if(n>1)
	        {
	            res-=res/n;
	        }
	        return res;
	    }
	 
	 
	    
	 
	    
	 
	    static boolean prime(int n)
	    {
	        for(int i=2;i*i<=n;i++)
	        {
	            if(i%2==0 ||i%3==0)
	            {
	                return false;
	            }
	        }
	        return true;
	    }
   static String userIdGeneration(String input1,String input2,int input3,int input4) {
	    	if(input1.length()==input2.length()) {
	    		String arr[]=new String[2];
	    		
	    		arr[0]=input1;
	    		arr[1]=input2;
	    		
	    		Arrays.sort(arr);
	    	char c=arr[0].charAt(0);
	    	   String output=c+arr[1];
	    		
	    	   String k=Integer.toString(input3);
	    	
	    	char d=k.charAt(input4-1);
	    	
	    	output+=d;
	    		
	    	char e=k.charAt(k.length()-input4);
	    	output+=e;
	    	String res="";
	    	for(int i=0;i<output.length();i++) {
	    		if(Character.isUpperCase(output.charAt(i))){
	    			res+=Character.toLowerCase(output.charAt(i));
	    		}
	    		else {
	    			res+=Character.toUpperCase(output.charAt(i));
	    		}
	      	}
	    	return res;
	    	}
	    	
	    	
	    	else  {
String arr[]=new String[2];
	    		arr[0]=input1.length()>input2.length()?input2:input1;
	    		arr[1]=input1.length()>input2.length()?input1:input2;
	    		
	    		char c=arr[0].charAt(0);
	    		
	    		String output=c+arr[1];
	    		
	    	String k=Integer.toString(input3);
	    	
	    	char d=k.charAt(input4-1);
	    	
	    	output+=d;
	    		
	    	char e=k.charAt(k.length()-input4);
	    	output+=e;
	    	String res="";
	    	for(int i=0;i<output.length();i++) {
	    		if(Character.isUpperCase(output.charAt(i))){
	    			res+=Character.toLowerCase(output.charAt(i));
	    		}
	    		else {
	    			res+=Character.toUpperCase(output.charAt(i));
	    		}
	    	}
	    return res;
	    	}
	    	
	    }
	static int length(int len) {
		
		if(len==1) {
			return 1;
		}
		else if(len==2) {
			return 3;
		}
		else if(len==3) {
			return 6;
		}
		else if(len==4) {
			return 10;
		}
		return 0;
	}
	
	
public static int LargestFour(int arr[]) {
	Arrays.sort(arr);

	int n=arr.length;
	int count=0;
	int sum=0;
	for(int i=n-1;i>=1;i--) {
		sum+=arr[i];
	
			count++;
			if(count==4) {
				break;
			
		}
		
	}
	
	if(count<4) {
		sum+=arr[0];
	}
	
	return sum;
}
//Nikunj Gupta
public static void insertionSort(int array[]) {  
    int n = array.length;  
    for (int j = 1; j < n; j++) {  
        int key = array[j];  
        int i = j-1;  
        while ( (i > -1) && ( array [i] > key ) ) {  
            array [i+1] = array [i];  
            i--;  
        }  
        array[i+1] = key;  
    }  
} 



  static String solve23(int n) {
int k=0;
while(true) {
	if(n-2020*k<0) {
		return "NO";
	}
	if((n-2020*k)%2021==0) {
		return "YES";
	}
	k++;
}
	  
	
	}
	
	


public static long[] solution(long n,long m) {
	long arr[]=new long[2];
	if(n==m) {
		arr[0]=0;
		arr[1]=0;
	return arr;}
	
	if(n%m==0) {
		long teamsize=n/m;
		long posss=(teamsize*(teamsize-1))/2;
		
		
		arr[0]=posss*m;
		long wrostteam=n-(m-1);
		
		//long worstans=wrostteam/2;
	long maxans=((wrostteam)*(wrostteam-1))/2;
	
	arr[1]=maxans;
	return arr;
	}
	
	else {
		
		
	long teamsize=n/m;
	long modulo=n%m;
	long size1=teamsize+1;
	long ans1=modulo*((size1*(size1-1))/2)+(m-modulo)*((teamsize*(teamsize-1)/2));
	
		
		
		arr[0]=ans1;
		
long wrostteam=n-(m-1);
		
		//long worstans=wrostteam/2;
	long maxans=((wrostteam)*(wrostteam-1))/2;
	
	arr[1]=maxans;
		
		
		
return arr;
	}
	
	
	

}
public static void main(String[] args) throws IOException{
Scanner s=new Scanner(System.in);



long n=s.nextLong();
long m=s.nextLong();


long arr[]=solution(n,m);
System.out.println(arr[0]+" "+arr[1]);







}









public static ArrayList<Interval> insert(ArrayList<Interval> intervals, Interval newInterval) {


ArrayList<Interval>ans=new ArrayList<Interval>();

int min=Math.min(newInterval.start,newInterval.end);
int max=Math.max(newInterval.end,newInterval.start);
int i=0;
boolean flag=false;
boolean place=false;

while(i<intervals.size()){
    int val1=newInterval.start;
    int val2=newInterval.end;
    
    
    if(min<=val1&&max>=val1&&max<=val2){
    Interval p2=	new Interval(min,val2);
    	ans.add(p2);
        
        place=true;
        
    }
    
    else if(min<val1&&max<val1){
        ans.add(new Interval(min,max));
        place=true; 
        ans.add(new Interval(val1,val2));
        i++;
        break;
       
    }
    else if(min>=val1&&max<=val2){
        ans.add(new Interval(val1,val2));
        place=true;
    }
    
    else if(min>val1&&min>val2){
        ans.add(new Interval(val1,val2));
    }
    else if(min>=val1&&max>val2){
        
         min=Math.min(min,val1);
  i++;
  while(i<intervals.size()){
      Interval na=intervals.get(i);
      
      if(max<=na.end&&max>=na.start){
          Interval ni=new Interval(val1,na.end);
      ans.add(ni);
      flag=true;
      place=true;
         // System.out.println("tes");
        break;
      }
      //System.out.println("tes"+"klkl");
      i++;
      
  }
    
        
        
        
    }
    
    
    
}


while(i<intervals.size()){
    Interval df=intervals.get(i);
    Interval g=new Interval(df.start,df.end);
    ans.add(g);
    
    i++;
}
  



    if(place==false){
     Interval ni=new Interval(min,max);
       //  System.out.println("tes");
       ans.add(ni); 
}

return ans;


  }


public static int lower_bound(ArrayList<Long> ar,long k)
{
    int s=0;
    int e=ar.size();
    while (s !=e)
    {
        int mid = s+e>>1;
        if (ar.get(mid) <k)
        {
            s=mid+1;
        }
        else
        {
            e=mid;
        }
    }
    if(s==ar.size())
    {
        return ar.size()-1;
    }
    return s;
}


	
		
		


        
	       
	       
	      
			
	
	
	
	
 


	


 
 
  
    
   
 private static void printsubsequences(String c, String st) {
	// TODO Auto-generated method stub
	
	 
	 if(c.length()==0) {
		 System.out.println(st);
		 return;
	 }
	 
	 
	 printsubsequences(c.substring(1),st+c.charAt(0));
	 printsubsequences(c.substring(1),st);
	 
	 
}

private static boolean compare(HashMap<Character, Integer> smap, HashMap<Character, Integer> pmap) {
		// TODO Auto-generated method stub
	 
	 for(char ch:smap.keySet()) {
		 if(smap.get(ch)!=pmap.get(ch)) {
			 return false;
		 }
	 }
		return true;
	}


private static boolean BinarySearch(int search, int[] val, int n)
 {
		// TODO Auto-generated method stub
		
	 int start=0;
	 int end=val.length-1;
	 while(start<=end) {
		 int mid=(start+end)/2;
		 
		 
		 if(val[mid]==search) {
			 return true;
		 }
		 else if(val[mid]<search) {
			 start=mid+1;
		 }
		 else {
			 end=mid-1;
		 }
		 
	 }
	 return false;
	 }


	
 
 
 
 static long findGCD(ArrayList<Long> arr,long start, long n) 
	    { 
	        long result = arr.get((int)start); 
	        for (int i = (int)start+1; i < n; i++) 
	            result = GCD(arr.get(i), result); 
	  
	        return result; 
	    } 
	 
	   
	 
	   

	    static long re(long n)
	    {
	        n+=1;
	        while(n%10==0)
	        {
	            n/=10;
	        }
	        return n;
	    }
	   
	   


	    
	 
	 
	 
	 
	 
	 
	    
	 
	    //xor range query
	    static long xor(long n)
	    {
	 
	        if(n%4==0)
	        {
	            return n;
	        }
	        if(n%4==1)
	        {
	            return  1;
	        }
	        if(n%4==2)
	        {
	            return n+1;
	        }
	        return 0;
	    }
	 
	    static long xor(long a,long b)
	    {
	        return xor(b)^xor(a-1);
	    }
	 
	 
	    
	 
	  
	   
	    
	 
	    
	       
	    
	 
	    
	   
	  
	 
	 

	   
	   
	    static void swap(char c,char p)
	    {
	        char t = c;
	        c = p;
	        p = t;
	    }
	 
	    static long max(long n,long m)
	    {
	        return Math.max(n,m);
	    }
	    static long min(long n,long m)
	    {
	        return Math.min(n,m);
	    }
	 
//	    double nd() throws IOException
//	    {
//	        return Double.parseDouble(in.next());
//	    }
//	    int ni() throws IOException
//	    {
//	        return Integer.parseInt(in.next());
//	    }
//	 
//	    long nl() throws IOException
//	    {
//	        return Long.parseLong(in.next());
//	    }
//	 
//	    String si() throws IOException
//	    {
//	        return in.next();
//	    }
//	 
//	 
	  
	   
	    static int abs(int n)
	    {
	        return Math.abs(n);
	    }
	 
	    static class Scanner 
	    {
	        StringTokenizer st;
	        BufferedReader br;
	 
	        public Scanner(InputStream s){  br = new BufferedReader(new InputStreamReader(s));}
	 
	        public String next() throws IOException 
	        {
	            while (st == null || !st.hasMoreTokens()) 
	            {
	                st = new StringTokenizer(br.readLine());
	            }
	            return st.nextToken();
	        }
	 
	        public int nextInt() throws IOException {return Integer.parseInt(next());}
	        
	        public long nextLong() throws IOException {return Long.parseLong(next());}
	 
	        public String nextLine() throws IOException {return br.readLine();}
	 
	        public boolean ready() throws IOException {return br.ready();}
	 
	 
	    }
	 
	    
	}
	 
	 
	 
	class Pair implements Comparable<Pair>
	{
	   int x,y;
	    public Pair(int x,int y)
	    {
	        this.x = x;
	        this.y = y;
	    }
	    public int compareTo(Pair o)
	    {
	        return this.y-o.y;
	    }
	}

