import java.io.*;
import java.util.*;
import java.math.*;
public class Main{

    static long M=(long)1e9+7;
    
    public static void main(String[] args) {
        FastReader fs=new FastReader();
        long n=fs.nextLong();
        long k=fs.nextLong();
        long[]arr=new long[(int)n];
        for(int i=0;i<n;i++){
        	arr[i]=fs.nextLong();
        }
        long[] dp=new long[(int)n];
        for(int i=0;i<n;i++){
        	dp[i]=Integer.MAX_VALUE;
        }
        dp[0]=0;
        for(int i=1;i<n;i++){
        	for(int j=1;j<=k;j++){
        		if((i-j)>=0){
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		}
        	}
        }
        System.out.println(dp[(int)n-1]);
    }
        
    public static void p(long[]dp){
    		for(int j=0;j<dp.length;j++){
    			System.out.print(dp[j]+"  ");
    		}
    		System.out.println();
    	
    }
    
    public static long inv(long a, long mod){
        return pow(a, mod-2,mod);
    }
    public static long mul(long a,long b,long mod){
        long res=0;
        while(b!=0){
            if ((b & 1) == 1){ res = (res + a) % mod;}
            a = (a + a) % mod;
            b >>= 1;
        }
        return res;
    }
    
    public static long pow(long a, long n, long mod){
        long res=1;
        while(n != 0){
            if ((n & 1) == 1) res = mul(res, a, mod)%mod;
            a = mul(a , a, mod)%mod;
            n >>= 1;
        }
        return res;
    }
    
    public static long gcd(long a, long b){
        if(a == 0) return b;
        return b == 0 ? a: gcd(b, a % b);
    }

    static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    }
} import java.io.*; io.* java import java.util.*; util.* java import java.math.*; math.* java public class Main{

    static long M=(long)1e9+7;
    
    public static void main(String[] args) {
        FastReader fs=new FastReader();
        long n=fs.nextLong();
        long k=fs.nextLong();
        long[]arr=new long[(int)n];
        for(int i=0;i<n;i++){
        	arr[i]=fs.nextLong();
        }
        long[] dp=new long[(int)n];
        for(int i=0;i<n;i++){
        	dp[i]=Integer.MAX_VALUE;
        }
        dp[0]=0;
        for(int i=1;i<n;i++){
        	for(int j=1;j<=k;j++){
        		if((i-j)>=0){
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		}
        	}
        }
        System.out.println(dp[(int)n-1]);
    }
        
    public static void p(long[]dp){
    		for(int j=0;j<dp.length;j++){
    			System.out.print(dp[j]+"  ");
    		}
    		System.out.println();
    	
    }
    
    public static long inv(long a, long mod){
        return pow(a, mod-2,mod);
    }
    public static long mul(long a,long b,long mod){
        long res=0;
        while(b!=0){
            if ((b & 1) == 1){ res = (res + a) % mod;}
            a = (a + a) % mod;
            b >>= 1;
        }
        return res;
    }
    
    public static long pow(long a, long n, long mod){
        long res=1;
        while(n != 0){
            if ((n & 1) == 1) res = mul(res, a, mod)%mod;
            a = mul(a , a, mod)%mod;
            n >>= 1;
        }
        return res;
    }
    
    public static long gcd(long a, long b){
        if(a == 0) return b;
        return b == 0 ? a: gcd(b, a % b);
    }

    static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    }
} Main static long M=(long)1e9+7; M (long)1e9+7 (long)1e9 7 public static void main(String[] args) {
        FastReader fs=new FastReader();
        long n=fs.nextLong();
        long k=fs.nextLong();
        long[]arr=new long[(int)n];
        for(int i=0;i<n;i++){
        	arr[i]=fs.nextLong();
        }
        long[] dp=new long[(int)n];
        for(int i=0;i<n;i++){
        	dp[i]=Integer.MAX_VALUE;
        }
        dp[0]=0;
        for(int i=1;i<n;i++){
        	for(int j=1;j<=k;j++){
        		if((i-j)>=0){
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		}
        	}
        }
        System.out.println(dp[(int)n-1]);
    } main {
        FastReader fs=new FastReader();
        long n=fs.nextLong();
        long k=fs.nextLong();
        long[]arr=new long[(int)n];
        for(int i=0;i<n;i++){
        	arr[i]=fs.nextLong();
        }
        long[] dp=new long[(int)n];
        for(int i=0;i<n;i++){
        	dp[i]=Integer.MAX_VALUE;
        }
        dp[0]=0;
        for(int i=1;i<n;i++){
        	for(int j=1;j<=k;j++){
        		if((i-j)>=0){
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		}
        	}
        }
        System.out.println(dp[(int)n-1]);
    } FastReader fs=new FastReader(); fs new FastReader() long n=fs.nextLong(); n fs.nextLong() fs.nextLong fs long k=fs.nextLong(); k fs.nextLong() fs.nextLong fs long[]arr=new long[(int)n]; arr new long[(int)n] (int)n for(int i=0;i<n;i++){
        	arr[i]=fs.nextLong();
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        	arr[i]=fs.nextLong();
        } {
        	arr[i]=fs.nextLong();
        } arr[i]=fs.nextLong() arr[i] arr i fs.nextLong() fs.nextLong fs long[] dp=new long[(int)n]; dp new long[(int)n] (int)n for(int i=0;i<n;i++){
        	dp[i]=Integer.MAX_VALUE;
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        	dp[i]=Integer.MAX_VALUE;
        } {
        	dp[i]=Integer.MAX_VALUE;
        } dp[i]=Integer.MAX_VALUE dp[i] dp i Integer.MAX_VALUE Integer Integer.MAX_VALUE dp[0]=0 dp[0] dp 0 0 for(int i=1;i<n;i++){
        	for(int j=1;j<=k;j++){
        		if((i-j)>=0){
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		}
        	}
        } int i=1; int i=1; i 1 i<n i n i++ i++ i {
        	for(int j=1;j<=k;j++){
        		if((i-j)>=0){
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		}
        	}
        } {
        	for(int j=1;j<=k;j++){
        		if((i-j)>=0){
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		}
        	}
        } for(int j=1;j<=k;j++){
        		if((i-j)>=0){
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		}
        	} int j=1; int j=1; j 1 j<=k j k j++ j++ j {
        		if((i-j)>=0){
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		}
        	} {
        		if((i-j)>=0){
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		}
        	} if((i-j)>=0){
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		} (i-j)>=0 (i-j) i j 0 {
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		} dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j])) dp[i] dp i Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j])) Math.min Math dp[i] dp i dp[i-j]+Math.abs(arr[i]-arr[i-j]) dp[i-j] dp i-j i j Math.abs(arr[i]-arr[i-j]) Math.abs Math arr[i]-arr[i-j] arr[i] arr i arr[i-j] arr i-j i j System.out.println(dp[(int)n-1]) System.out.println System.out System System.out dp[(int)n-1] dp (int)n-1 (int)n 1 String[] args args public static void p(long[]dp){
    		for(int j=0;j<dp.length;j++){
    			System.out.print(dp[j]+"  ");
    		}
    		System.out.println();
    	
    } p {
    		for(int j=0;j<dp.length;j++){
    			System.out.print(dp[j]+"  ");
    		}
    		System.out.println();
    	
    } for(int j=0;j<dp.length;j++){
    			System.out.print(dp[j]+"  ");
    		} int j=0; int j=0; j 0 j<dp.length j dp.length dp dp.length j++ j++ j {
    			System.out.print(dp[j]+"  ");
    		} {
    			System.out.print(dp[j]+"  ");
    		} System.out.print(dp[j]+"  ") System.out.print System.out System System.out dp[j]+"  " dp[j] dp j "  " System.out.println() System.out.println System.out System System.out long[]dp dp public static long inv(long a, long mod){
        return pow(a, mod-2,mod);
    } inv {
        return pow(a, mod-2,mod);
    } return pow(a, mod-2,mod); pow(a, mod-2,mod) pow a mod-2 mod 2 mod long a a long mod mod public static long mul(long a,long b,long mod){
        long res=0;
        while(b!=0){
            if ((b & 1) == 1){ res = (res + a) % mod;}
            a = (a + a) % mod;
            b >>= 1;
        }
        return res;
    } mul {
        long res=0;
        while(b!=0){
            if ((b & 1) == 1){ res = (res + a) % mod;}
            a = (a + a) % mod;
            b >>= 1;
        }
        return res;
    } long res=0; res 0 while(b!=0){
            if ((b & 1) == 1){ res = (res + a) % mod;}
            a = (a + a) % mod;
            b >>= 1;
        } b!=0 b 0 {
            if ((b & 1) == 1){ res = (res + a) % mod;}
            a = (a + a) % mod;
            b >>= 1;
        } if ((b & 1) == 1){ res = (res + a) % mod;} (b & 1) == 1 (b & 1) b 1 1 { res = (res + a) % mod;} res = (res + a) % mod res (res + a) % mod (res + a) res a mod a = (a + a) % mod a (a + a) % mod (a + a) a a mod b >>= 1 b 1 return res; res long a a long b b long mod mod public static long pow(long a, long n, long mod){
        long res=1;
        while(n != 0){
            if ((n & 1) == 1) res = mul(res, a, mod)%mod;
            a = mul(a , a, mod)%mod;
            n >>= 1;
        }
        return res;
    } pow {
        long res=1;
        while(n != 0){
            if ((n & 1) == 1) res = mul(res, a, mod)%mod;
            a = mul(a , a, mod)%mod;
            n >>= 1;
        }
        return res;
    } long res=1; res 1 while(n != 0){
            if ((n & 1) == 1) res = mul(res, a, mod)%mod;
            a = mul(a , a, mod)%mod;
            n >>= 1;
        } n != 0 n 0 {
            if ((n & 1) == 1) res = mul(res, a, mod)%mod;
            a = mul(a , a, mod)%mod;
            n >>= 1;
        } if ((n & 1) == 1) res = mul(res, a, mod)%mod; (n & 1) == 1 (n & 1) n 1 1 res = mul(res, a, mod)%mod res mul(res, a, mod)%mod mul(res, a, mod) mul res a mod mod a = mul(a , a, mod)%mod a mul(a , a, mod)%mod mul(a , a, mod) mul a a mod mod n >>= 1 n 1 return res; res long a a long n n long mod mod public static long gcd(long a, long b){
        if(a == 0) return b;
        return b == 0 ? a: gcd(b, a % b);
    } gcd {
        if(a == 0) return b;
        return b == 0 ? a: gcd(b, a % b);
    } if(a == 0) return b; a == 0 a 0 return b; b return b == 0 ? a: gcd(b, a % b); b == 0 ? a: gcd(b, a % b) b == 0 b 0 a gcd(b, a % b) gcd b a % b a b long a a long b b static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } FastReader BufferedReader br; br StringTokenizer st; st public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } FastReader { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } br = new BufferedReader(new
                     InputStreamReader(System.in)) br new BufferedReader(new
                     InputStreamReader(System.in)) String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } next { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } st == null || !st.hasMoreElements() st == null st null !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } IOException  e { 
                    e.printStackTrace(); 
                } e.printStackTrace() e.printStackTrace e { 
                    st = new StringTokenizer(br.readLine()); 
                } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } nextInt { 
            return Integer.parseInt(next()); 
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next long nextLong() 
        { 
            return Long.parseLong(next()); 
        } nextLong { 
            return Long.parseLong(next()); 
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } nextDouble { 
            return Double.parseDouble(next()); 
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } nextLine { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } String str = ""; str "" try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } catch (IOException e) 
            { 
                e.printStackTrace(); 
            } IOException e { 
                e.printStackTrace(); 
            } e.printStackTrace() e.printStackTrace e { 
                str = br.readLine(); 
            } str = br.readLine() str br.readLine() br.readLine br return str; str public class Main{

    static long M=(long)1e9+7;
    
    public static void main(String[] args) {
        FastReader fs=new FastReader();
        long n=fs.nextLong();
        long k=fs.nextLong();
        long[]arr=new long[(int)n];
        for(int i=0;i<n;i++){
        	arr[i]=fs.nextLong();
        }
        long[] dp=new long[(int)n];
        for(int i=0;i<n;i++){
        	dp[i]=Integer.MAX_VALUE;
        }
        dp[0]=0;
        for(int i=1;i<n;i++){
        	for(int j=1;j<=k;j++){
        		if((i-j)>=0){
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		}
        	}
        }
        System.out.println(dp[(int)n-1]);
    }
        
    public static void p(long[]dp){
    		for(int j=0;j<dp.length;j++){
    			System.out.print(dp[j]+"  ");
    		}
    		System.out.println();
    	
    }
    
    public static long inv(long a, long mod){
        return pow(a, mod-2,mod);
    }
    public static long mul(long a,long b,long mod){
        long res=0;
        while(b!=0){
            if ((b & 1) == 1){ res = (res + a) % mod;}
            a = (a + a) % mod;
            b >>= 1;
        }
        return res;
    }
    
    public static long pow(long a, long n, long mod){
        long res=1;
        while(n != 0){
            if ((n & 1) == 1) res = mul(res, a, mod)%mod;
            a = mul(a , a, mod)%mod;
            n >>= 1;
        }
        return res;
    }
    
    public static long gcd(long a, long b){
        if(a == 0) return b;
        return b == 0 ? a: gcd(b, a % b);
    }

    static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    }
} public class Main{

    static long M=(long)1e9+7;
    
    public static void main(String[] args) {
        FastReader fs=new FastReader();
        long n=fs.nextLong();
        long k=fs.nextLong();
        long[]arr=new long[(int)n];
        for(int i=0;i<n;i++){
        	arr[i]=fs.nextLong();
        }
        long[] dp=new long[(int)n];
        for(int i=0;i<n;i++){
        	dp[i]=Integer.MAX_VALUE;
        }
        dp[0]=0;
        for(int i=1;i<n;i++){
        	for(int j=1;j<=k;j++){
        		if((i-j)>=0){
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		}
        	}
        }
        System.out.println(dp[(int)n-1]);
    }
        
    public static void p(long[]dp){
    		for(int j=0;j<dp.length;j++){
    			System.out.print(dp[j]+"  ");
    		}
    		System.out.println();
    	
    }
    
    public static long inv(long a, long mod){
        return pow(a, mod-2,mod);
    }
    public static long mul(long a,long b,long mod){
        long res=0;
        while(b!=0){
            if ((b & 1) == 1){ res = (res + a) % mod;}
            a = (a + a) % mod;
            b >>= 1;
        }
        return res;
    }
    
    public static long pow(long a, long n, long mod){
        long res=1;
        while(n != 0){
            if ((n & 1) == 1) res = mul(res, a, mod)%mod;
            a = mul(a , a, mod)%mod;
            n >>= 1;
        }
        return res;
    }
    
    public static long gcd(long a, long b){
        if(a == 0) return b;
        return b == 0 ? a: gcd(b, a % b);
    }

    static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    }
} Main
import java.io.*;
import java.util.*;
import java.math.*;
public class Main{

    static long M=(long)1e9+7;
    
    public static void main(String[] args) {
        FastReader fs=new FastReader();
        long n=fs.nextLong();
        long k=fs.nextLong();
        long[]arr=new long[(int)n];
        for(int i=0;i<n;i++){
        	arr[i]=fs.nextLong();
        }
        long[] dp=new long[(int)n];
        for(int i=0;i<n;i++){
        	dp[i]=Integer.MAX_VALUE;
        }
        dp[0]=0;
        for(int i=1;i<n;i++){
        	for(int j=1;j<=k;j++){
        		if((i-j)>=0){
        			dp[i]=Math.min(dp[i],dp[i-j]+Math.abs(arr[i]-arr[i-j]));
        		}
        	}
        }
        System.out.println(dp[(int)n-1]);
    }
        
    public static void p(long[]dp){
    		for(int j=0;j<dp.length;j++){
    			System.out.print(dp[j]+"  ");
    		}
    		System.out.println();
    	
    }
    
    public static long inv(long a, long mod){
        return pow(a, mod-2,mod);
    }
    public static long mul(long a,long b,long mod){
        long res=0;
        while(b!=0){
            if ((b & 1) == 1){ res = (res + a) % mod;}
            a = (a + a) % mod;
            b >>= 1;
        }
        return res;
    }
    
    public static long pow(long a, long n, long mod){
        long res=1;
        while(n != 0){
            if ((n & 1) == 1) res = mul(res, a, mod)%mod;
            a = mul(a , a, mod)%mod;
            n >>= 1;
        }
        return res;
    }
    
    public static long gcd(long a, long b){
        if(a == 0) return b;
        return b == 0 ? a: gcd(b, a % b);
    }

    static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    }
}