Help me in solving DIVISOR problem

My issue

i want a logic

My code

/* package codechef; // don't place package name! */

import java.util.*;


/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
	public static void main (String[] args) 
	{
		Scanner obj = new Scanner(System.in);
		int n = obj.nextInt();
		while(n-->0)
		{
		    int k = obj.nextInt();
		    n = n/k;
		    System.out.println(n);
		}
	}
}

Problem Link: DIVISOR Problem - CodeChef