Help me in solving BULLET problem

My issue

My code

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

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner sc = new Scanner(System.in);
	    int t = sc.nextInt();
	    int []a = new int[3];
	    int r,m=0;
	    for(int j=0;j<t;j++)
	    {
	    for(int i=0;i<3;i++)
	    {
	        a[i] = sc.nextInt();
	    }
	    }
	   for(int j=0;j<t;j++)
	    {
	       
	        {
	          r = a[1]/a[0];
	           m = a[2]-r;
	        }
	    if(m<0)
	       {
	        System.out.println(0);
	       }
	    else{
	        System.out.println(m);
	        }
	    }
	}
}

Problem Link: BULLET Problem - CodeChef