Many many thanks to Maruf.
But it is just a stupid joke nothing else.
If there is no newline so why the judges gave this condition-------
he input begins with a single integer, C, indicating the number of test cases following, each of them as described below. This line is followed by a blank line, and there is also a blank line between two consecutive test cases.
public class Main {
public static void main (String [] args) throws NumberFormatException, IOException{
BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(buffer.readLine());
buffer.readLine();
int s ;
int t ;
int u ;
int v ;
for(int i = 0;i<n;i++){
int x = Integer.parseInt(buffer.readLine());
int y = Integer.parseInt(buffer.readLine());
for(int j = 0;j<x;j++){
StringTokenizer f =new StringTokenizer(buffer.readLine());
int a = Integer.parseInt(f.nextToken());
int b = Integer.parseInt(f.nextToken());
int c = Integer.parseInt(f.nextToken());
int d = Integer.parseInt(f.nextToken());
s = a+b;
t = c+d;
u = a-b;
v = c-d ;
if((s%2==0 && t%2!=0)||(s%2!=0 && t%2==0) )
System.out.println("no move");
else
if(s!=t && u!=v)
System.out.println(2);
else
System.out.println(1);
public class Main {
public static void main(String[] args) throws NumberFormatException,
IOException {
BufferedReader buffer = new BufferedReader(new InputStreamReader(
System.in));
long n = Long.parseLong(buffer.readLine());
long s;
long t;
long u;
long v;
for (int i = 0; i < n; i++) {
// Moved readline inside for loop
buffer.readLine();
long x = Long.parseLong(buffer.readLine());
long y = Long.parseLong(buffer.readLine());
...
Check input and AC output for over 7,500 problems onuDebug!
lighted wrote:It will be good if you remove your code after getting accepted
You said it! A significant percentage of people post code when asking for help and then leave it on there once they've figured out the solution. The forum is full of nearly AC (or even AC) code like that. Requesting people to remove their code hardly every works. But perhaps it's worth trying.
Check input and AC output for over 7,500 problems onuDebug!