QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#858376#4755. Romualdych and remaindersrotcar07AC ✓336ms3584kbC++23288b2025-01-16 16:44:162025-01-16 16:44:38

Judging History

This is the latest submission verdict.

  • [2025-01-16 16:44:38]
  • Judged
  • Verdict: AC
  • Time: 336ms
  • Memory: 3584kb
  • [2025-01-16 16:44:16]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    int n;cin>>n;
    while(n--){
        ll a,b,r;cin>>a>>b>>r;
        if(a<=r&&r<=b) cout<<r<<" "<<r+1<<'\n';
        else if(r*2>b) cout<<"-1 -1\n";
        else cout<<b<<' '<<b-r<<'\n';
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3584kb

input:

2
6 8 0
3 5 10

output:

8 8
-1 -1

result:

ok good (2 test cases)

Test #2:

score: 0
Accepted
time: 336ms
memory: 3584kb

input:

200000
611798478556051906 630182047660550624 712293791209079022
853240706540428329 922637400970484112 626594903783173477
197243701653451300 295095047071741142 449297196551949579
839353411868302800 886351194213373918 579004595736495353
939764026573336488 969028156240926594 445397937769727031
19628624...

output:

-1 -1
-1 -1
-1 -1
-1 -1
969028156240926594 523630218471199563
670222852464819192 670222852464819193
607435423586070461 607435423586070462
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
538701390622294462 538701390622294463
494736301002171927 494736301002171928
-1 -1
-1 -1
244547860816547665 244547860816547666
-1 -1
...

result:

ok good (200000 test cases)

Test #3:

score: 0
Accepted
time: 327ms
memory: 3584kb

input:

200000
444075082905955212 802308689767311868 947445012554350370
189712449152268906 722211766350578023 813210016550689763
241173799198780926 737431369404303647 441085462822149643
909178105049137785 919062028870369627 351506680005125813
114468759318784976 414160017219340561 146742946006575994
24895827...

output:

-1 -1
-1 -1
441085462822149643 441085462822149644
919062028870369627 567555348865243814
146742946006575994 146742946006575995
579033886961160680 579033886961160681
239123214453467791 239123214453467792
585344960001255123 585344960001255124
-1 -1
510078244614758969 510078244614758970
5129527727263654...

result:

ok good (200000 test cases)

Test #4:

score: 0
Accepted
time: 291ms
memory: 3584kb

input:

200000
998305805090772827 999072070643391468 604067191
22356095499959347 235698493012767194 903638320
341575406950983969 717022140443605143 767378659
92028709868496889 270467640055235411 412458115
769481683175136951 847550752944179142 663931525
374672783517679821 380968011237098534 833611282
6907034...

output:

999072070643391468 999072070039324277
235698493012767194 235698492109128874
717022140443605143 717022139676226484
270467640055235411 270467639642777296
847550752944179142 847550752280247617
380968011237098534 380968010403487252
915335178758976746 915335177912965775
766582715259616716 766582715227346...

result:

ok good (200000 test cases)

Test #5:

score: 0
Accepted
time: 289ms
memory: 3584kb

input:

200000
598456382565331642 747574474812947769 451826400
453761535728303888 597585453606379554 825029656
602954069450855743 769520347573936679 620674605
477263585804371851 936533774622690320 698459001
995888582357313041 996883916745448887 571839055
775056304911101276 956791928599183438 926639848
76086...

output:

747574474812947769 747574474361121369
597585453606379554 597585452781349898
769520347573936679 769520346953262074
936533774622690320 936533773924231319
996883916745448887 996883916173609832
956791928599183438 956791927672543590
832063681132452714 832063681058731117
758972859642245021 758972858752461...

result:

ok good (200000 test cases)

Test #6:

score: 0
Accepted
time: 259ms
memory: 3584kb

input:

200000
220754822102031637 974459998387569518 75
827527026486320772 852313839331435760 677
761809399512149173 864054348823059162 833
842388994453436231 934907744690978886 927
966939175671938287 982681483165474776 384
694014738244880147 837603843931762700 374
221737055181184640 760136200539156696 268
...

output:

974459998387569518 974459998387569443
852313839331435760 852313839331435083
864054348823059162 864054348823058329
934907744690978886 934907744690977959
982681483165474776 982681483165474392
837603843931762700 837603843931762326
760136200539156696 760136200539156428
903674924911042717 903674924911042...

result:

ok good (200000 test cases)

Test #7:

score: 0
Accepted
time: 277ms
memory: 3584kb

input:

200000
704979208578857897 704979208578858263 465
388406252386899628 388406252386900113 301
209312700860742298 209312700860742997 906
772700899433252468 772700899433253308 592
736791052844046000 736791052844046308 74
893474183426763148 893474183426763449 916
538412047694905923 538412047694905932 853
...

output:

704979208578858263 704979208578857798
388406252386900113 388406252386899812
209312700860742997 209312700860742091
772700899433253308 772700899433252716
736791052844046308 736791052844046234
893474183426763449 893474183426762533
538412047694905932 538412047694905079
885634295565791684 885634295565791...

result:

ok good (200000 test cases)

Test #8:

score: 0
Accepted
time: 294ms
memory: 3584kb

input:

200000
571870039833743143 571870039833744093 812888066
307377373616152280 307377373616153238 421511177
637562489313463024 637562489313463560 734160492
506909427753562834 506909427753563565 771008416
277951431738032739 277951431738033737 663464969
366344594668315092 366344594668315848 856411351
57968...

output:

571870039833744093 571870039020856027
307377373616153238 307377373194642061
637562489313463560 637562488579303068
506909427753563565 506909426982555149
277951431738033737 277951431074568768
366344594668315848 366344593811904497
579688983967258406 579688983767515828
581509989517826277 581509988995740...

result:

ok good (200000 test cases)

Extra Test:

score: 0
Extra Test Passed