UNITGCD - Editorial

This problem is a classic example where size of output file has really hard boundary.
Basically SIGXFXZ error says “Exceeded max file size”
Every program when ran online has maximum output file size limit and blank spaces at the end of line increases the size.
Thus in your program if you find a way to avoid the blank space at end of file. your solution is excepted.
For Example
'3 1 2 3 ’ --> This will produce error (observe an extra space after second 3)
‘3 1 2 3’ --> This will be accepted

My code is passing 1 test case, but is giving WA in rest 2 cases. Can someone please look into this and share the reason.
Link to solution: CodeChef: Practical coding for everyone

PS: Python3

Try

1
1

Take the case of n=1:
1//2 results in 0
it must be 1

My solution is wrong, but it gives correct answer to all test cases.
Check this

  1. Calculate prime numbers and print them
  2. Print odd & even pair wise

Hi , I have used same method but getting TLE .

Please suggest improvement and reason for TLE

my loop is printing till 10948 only why so

i used the same logic but didn’t know it is called pigeonhole principle (i think i studied somewhere about this n forgot the name of principle,thanks for reminding) :blush:

2nd subTask is passing but I don’t know where my code is failing please have a look and correct me if I’m wrong somewhere!
@everule1 @taran_1407

might be due to fast input output not used, include it like following (then use only cin,cout)

int main(int argc, char const *argv[])
{
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int t;
cin>>t;
while(t–)
{ …

can anybody help me
why i am getting tle
plzz
https://www.codechef.com/viewsolution/32960963

There will be two cases bro when n is odd and even,
Refer this: CodeChef: Practical coding for everyone

If n=6 then why can’t we do like
4 1 2 3 5
1 4
1 6

Please explain !!