problem link:

my solution link

https://www.codechef.com/viewsolution/48352082

help me out

First of all correct the problem link .

Now your code fails even on sample test case , do remember that the value of elements should be from 1 to N^2 , and all of them should be distinct .

1 Like

now , sir ?? i corrected the link

Try reading the editorial , as it is failing for every odd value of N .

1 Like

Sir, after taking 1 3 as a test case.It is showing 1 2 3 4 5 6 7 8 9 as it is satisfied the condition. Example :1+5=6,2+4=6,5+9=14.

Ohhh Sorry , I wanted to write for every even value of N it is failing . No need to write Sir , I am still a young boy .

1 Like

The code in the link shows this as

1 3 5 7

10 12 14 16

17 19 21 23

26 28 30 32

1 Like

thank you so muchโฆ i got itโฆ

1 Like

You last `else`

statement doesnโt have an opening (`{`

) and closing curly brace (`}`

)