import java.util.*; class k_means { static int count1,count2,count3; static int d[]; static int k[][]; static int tempk[][]; static double m[]; static double diff[]; static int n,p; static int cal_diff(int a) // This method will determine the cluster in which an element go at a particular step. { int temp1=0; for(int i=0; im[i]) diff[i]=a-m[i]; else diff[i]=m[i]-a; } int val=0; double temp=diff[0]; for(int i=0; i