Help me in solving DARLIG problem

My issue

What’s wrong in this it shows correct output but why submission of an answer get failed

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
	{
		// your code goes here
		Scanner sc=new Scanner(System.in);
	int	t=sc.nextInt();
		for(int i=1;i<=t;i++)
		{
		  int n=sc.nextInt();
		  int k=sc.nextInt();
		  if(n%4==0||n==0)
		  {
		    if(k==0)
		    {
		    System.out.println("Off");
		    }
		    else
		    {
		      System.out.println("On");
		    }
		  }
		  else
		  {
		 System.out.print("Ambiguous");
		  }
		 }
		  }
		  
    }


Problem Link: DARLIG Problem - CodeChef

In case if n=3 and k=0
we know that if it is in the off state then it is currently at level 4, from there we move 3 steps forward this would reach at level 3 which, is On state .
Now,
if k=1 and any value of n which is not a multiple of 4 ,we are not too sure whether it is in level 4 or any other level therefore it is marked as ambiguous.

This is the case which is not satisfied in your program.