/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 348.0 KiB
#2 Accepted 43ms 1.176 MiB
#3 Accepted 43ms 1.625 MiB
#4 Accepted 50ms 2.27 MiB

Code

// I AM A MUSLIM

#include "bits/stdc++.h"

#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")

#define fast_io std::ios::sync_with_stdio(0);std::cin.tie(0)
#define lli long long int
#define flush fflush(stdout)
#define line printf("\n")
#define yn(a, b) printf("%s\n", (a) >= (b) ? "Yes":"No")
#define amodm(a, M) (((a)%M+M)%M)
#define read(s) std::string s;std::cin >> s
#define readL(s) std::string s;getline(std::cin, s)
#define write(s) printf("%s\n", s.c_str())
// #define int lli

using pii = std::pair<int,int>;
const int MOD = 1000000007;
const int mxN = 500100;

signed main() {
    int testCases=1;
    scanf("%d",&testCases);
    
    for (int TC = 1; TC <= testCases; TC++) {
        int a, b, x;
        scanf("%d%d%d",&a,&b,&x);
        if (x >= 0) {
            if (a+x <= b) {
                printf("%d %d\n", a+x, a);
            } else puts("-1 -1");
        } else {
            x *= -1;
            if (a+x <= b) {
                printf("%d %d\n", a, a+x);
            } else puts("-1 -1");
        }
    }
    
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1186 Equal to X
Contest
Brain Booster #9
Language
C++17 (G++ 13.2.0)
Submit At
2025-04-06 15:39:00
Judged At
2025-04-06 15:39:00
Judged By
Score
100
Total Time
50ms
Peak Memory
2.27 MiB