String s[]= scanner.nextLine().split(" ");for(int i =0 ;i < s.length;i++){ a[i]= Integer.parseInt(s[i]);}
Scanner scanner = new Scanner(System.in);
int numOfBlocks = scanner.nextInt();
int weightArray[] = new weightArray[numOfBlocks];
for(int i=0;i<numOfBlocks;i++)
{
weightArray[i] = scanner.nextInt();
}
scanner.close();
//your logic