/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 76ms 22.258 MiB
#2 Accepted 76ms 21.582 MiB
#3 Accepted 110ms 23.02 MiB
#4 Accepted 155ms 23.477 MiB
#5 Accepted 379ms 25.062 MiB
#6 Accepted 384ms 24.973 MiB
#7 Accepted 374ms 24.906 MiB
#8 Accepted 383ms 24.965 MiB
#9 Accepted 106ms 22.629 MiB
#10 Accepted 368ms 24.828 MiB

Code

from collections import *        # Useful for deque, Counter, defaultdict, namedtuple, etc.
from itertools import *          # Provides tools for combinations, permutations, product, etc.
from functools import *          # Includes tools like lru_cache for memoization, reduce, etc.
from heapq import *              # Provides heap operations like heappush, heappop, useful for priority queues
from bisect import *             # For efficient binary search and maintaining sorted lists
from math import *               # Includes functions like gcd, sqrt, factorial, isqrt, comb, etc.
from operator import *           # Includes functions like itemgetter, attrgetter, add, mul for functional programming
from array import *              # For efficient storage and manipulation of numeric arrays
from typing import *             # Provides typing hints (List, Tuple, Dict, etc.) to improve readability and error-checking
from decimal import *            # High-precision arithmetic operations, useful for certain precision tasks
from queue import *              # Includes Queue, LifoQueue, PriorityQueue useful in BFS, DFS, and other algorithms
import sys
sys.setrecursionlimit(10**5)
def POW(base, exp, mod):
    result = 1
    base = base % mod  # Handle case when base is larger than mod
    while exp > 0:
        if exp % 2 == 1:  # If exp is odd, multiply base with result
            result = (result * base) % mod
        exp = exp // 2    # Divide exp by 2
        base = (base * base) % mod  # Square the base
    return result
def IL():
  return [int(i) for i in input().split()]
def CL():
  return [i for i in input().split()]
def I():
  return input()
def inti():
  return int(input())
def db(x):
  return print(x)
def dbl(x):
  return print(*x)
def dbm(x):
  for i in x:
    print(i)
def sq(x):
  return x==int(x**0.5)**2
def prime(n):
    if n <= 1:
        return False
    if n <= 3:
        return True
    if (n & 1) == 0 or n % 3 == 0:
        return False
    i = 5
    while i * i <= n:
        if n % i == 0 or n % (i + 2) == 0:
            return False
        i += 6
    return True

char="abcdefghijklmnopqrstuvwxyz"
mod=pow(10,9)+7


for _ in range(int(input())):
  a,b,x=IL()
  if x<=a:
    arr=[a-x,b]
  else:
    arr=[0,b-(x-a)]
  for i in range(2):
    arr[i]=max(arr[i],0)
  print(*arr)

Information

Submit By
Type
Submission
Problem
P1187 Ticket Battle: Hridoy vs Kamona
Contest
Brain Booster #9
Language
PyPy 3 (Python 3.9.18 PyPy 7.3.15)
Submit At
2025-04-06 15:43:00
Judged At
2025-04-06 15:43:00
Judged By
Score
100
Total Time
384ms
Peak Memory
25.062 MiB