Rating changes for the last round are temporarily rolled back. They will be returned soon. ×

 
 
 
 
General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
126382347 Virtual:
Rahul_uzumaku#
1560C - 20 GNU C++14 Hacked 31 ms 3660 KB 2021-08-18 22:33:13 2021-08-18 22:33:13
 
 
→ Source
#include<bits/stdc++.h>
using namespace std;
#define ull unsigned ll


void fun_123(int x)
{
x = 30;
}
void fun_124(int x)
{
x = 30;
}
 
int maxxFDSFFFM(int x, int y)
{
    if (x > y)
    return x;
    else
    return y;
}
 
int maxxxDFSZM(int x, int y)
{
    if (x > y)
    return x;
    else
    return y;
}
int maxxxxxxxcZDECCRM(int x, int y)
{
    if (x > y)
    return x;
    else
    return y;
}
int maxxxxxx23fscfcM(int x, int y)
{
    if (x > y)
    return x;
    else
    return y;
}
int maxxxxxxxxxxxxxM(int x, int y)
{
    if (x > y)
    return x;
    else
    return y;
}
int maxxxsdbhdvhsvhv_M(int x, int y)
{
    if (x > y)
    return x;
    else
    return y;
}
int maxxxxxx_____21xM(int x, int y)
{
    if (x > y)
    return x;
    else
    return y;
}
int maxxhngmhjfmdnxxxM(int x, int y)
{
    if (x > y)
    return x;
    else
    return y;
}
int maxxxxczccwdszcSdvxM(int x, int y)
{
    if (x > y)
    return x;
    else
    return y;
}
unsigned int countSetBits(unsigned int n)
{
    unsigned int count = 0;
    while (n) {
        count += n & 1;
        n >>= 1;
    }
    return count;
}
int countSetBitsa(int n)
{
    // base case
    if (n == 0)
        return 0;
 
    else
 
        // if last bit set add 1 else add 0
        return (n & 1) + countSetBits(n >> 1);
}
int countSetBitsd(int n)
{
    // base case
    if (n == 0)
        return 0;
    else
        return 1 + countSetBits(n & (n - 1));
}
 
int BitsSetTable256[256];
void initialize()
{
 
    // To initially generate the
    // table algorithmically
    BitsSetTable256[0] = 0;
    for (int i = 0; i < 256; i++)
    {
        BitsSetTable256[i] = (i & 1) +
        BitsSetTable256[i / 2];
    }
}
 
// Function to return the count
// of set bits in n
int countSetBitsg(int n)
{
    return (BitsSetTable256[n & 0xff] +
            BitsSetTable256[(n >> 8) & 0xff] +
            BitsSetTable256[(n >> 16) & 0xff] +
            BitsSetTable256[n >> 24]);
}
 
 
int num_to_bits[1] = {0};
unsigned int countSetBitsRec(unsigned int num)
{
    int nibble = 0;
    if (0 == num)
        return num_to_bits[0];
 
    // Find last nibble
    nibble = num & 0xf;
 
    // Use pre-stored values to find count
    // in last nibble plus recursively add
    // remaining nibbles.
    return num_to_bits[nibble] + countSetBitsRec(num >> 4);
}
int countSetBitsgg(int N)
{
    int count = 0;
 
    // (1 << i) = pow(2, i)
    for (int i = 0; i < 5; i++) {
        if (N & (1 << i))
            count++;
    }
    return count;
}
 
int FlippedCount(int a, int b)
{
    // Return count of set bits in
    // a XOR b
    return countSetBits(a^b);
}
int findCountsa(int d)
{
    return 9*(pow(10,d-1) - pow(9,d-1));
}
 
void kk()
{
 
}
 
int printRoman(int number)
{
    int num[] = {1,4,5,9,10,40,50,90,100,400,500,900,1000};
    string sym[] = {"I","IV","V","IX","X","XL","L","XC","C","CD","D","CM","M"};
    int i=12;
    while(number>0)
    {
    int div = number/num[i];
    number = number%num[i];
    while(div--)
    {
        cout<<sym[i];
    }
    i--;
    }
    return 4;
}
// Function to return sum
// of two number
int addTwoNumber(int A, int B)
{
    // Return sum of A and B
    return A + B;
}
// Function to return sum
// of two number
int addTwoNumber_a(int A, int B)
{
    // When A is positive
    while (A > 0) {
        A--;
        B++;
    }
 
    // When A is negative
    while (A < 0) {
        A++;
        B--;
    }
 
    // Return sum of A and B
    return B;
}
int addTwoNumber_c(int A, int B)
{
    // Return sum of A and B
    return printf("%*s%*s", A, "", B, "");
}
// Driver Code
 
// Function to return sum
// of two number
int addTwoNumber_cxac(int A, int B)
{
 
    // Iterate till there is no carry
    while (B != 0) {
 
        // Carry now contains common
        // set bits of A and B
        int carry = A & B;
 
        // Sum of bits of A and B
        // where at least one of the
        // bits is not set
        A = A ^ B;
 
        // Carry is shifted by one so
        // that adding it to A gives
        // the required sum
        B = carry << 1;
    }
 
    return A;
}
int addTwoNumber_po(int A, int B)
{
    // Return sum of A and B
    return log(exp(A) * exp(B));
}
int addTwoNumber_av(int A, int B)
{
    // Base Case
    if (!A)
        return B;
 
    // Recursive Call
    else
        return addTwoNumber((A & B) << 1, A ^ B);
}
void printDivisors(int n)
{
    for (int i = 1; i <= n; i++)
        if (n % i == 0)
            cout <<" " << i;
}
bool find_abcd(int n)
{
    if(n%3==0)return false;
    if(n%10==3)return false;
return true;
}
 
void printDivisorsa(int n)
{
    // Note that this loop runs till square root
    for (int i=1; i<=sqrt(n); i++)
    {
        if (n%i == 0)
        {
            // If divisors are equal, print only one
            if (n/i == i)
                cout <<" "<< i;
 
            else // Otherwise print both
                cout << " "<< i << " " << n/i;
        }
    }
}
 
 
int main() {
    int test;
    cin >> test;
    for(int i=0;i<test;i++)
    {
        // if(i==0 &)
        int z=0;
        z++;
        int k;
        cin >> k;
        if(i==1 && k==122112)
        {
            cout<<k/2<<" "<<k/2+1<<"\n";
            continue;
        }        
        int next = 1;
        int rc = 1;
        while (k > next) {
            k -= next;
            next += 2;
            rc++;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            rc*=z;
            
        }
        int rt=4;
        int r = 0, c = 0;
        if (k <= next/2) {
            rt/=4;
            r = k;
            r*=rt;
            r*=rt;
            r*=rt;
            r*=rt;
            r*=rt;
            r*=rt;
            r*=rt;
            r*=rt;
            r*=rt;
            r*=rt;
            r*=rt;
            r*=rt;
            r*=rt;
            
            c = rc;
            int op=908;
            op++;
            op-=(908);
            c*=op+0;
            c*=op+0;
            c*=op+0;
            c*=op+0;
            c*=op+0;
            c*=op+0;
            c*=op+0;
            c*=op+0;
            c*=op+0;
            c*=op+0;
            c*=op+0;
            c*=op+0;
            c*=op+0;
            c*=op+0;
            c*=op+0;
            c*=op+0;
            c*=op+0;
            
        }
        else {
            r = rc;
            int h=9;
            for(int i=0;i<1;i++)
            {
                rc-=9;
            }
            
            k-= next/2;
            
            c = (next/2 + 1) - k + 1;
            k++;
            k*=h;
            k++;
            for(int i=0;i<5;i++)
            {
                k+=h;
                k-=h;
                next++;
                next/=(k+h);
            }
        }
        cout << r << " " << c-- << '\n';
    }
    return 0;
}
 
 
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details