Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

hungry chef solution

for _ in range(int(input())):
    x,y,n,r = map(int,input().split())
    if r//y >= n:
        print(0,n)
    elif r//x < n:
        print(-1)
    else:
        c = (r-(y*n))//(x-y)
        if ((r-(y*n))%(x-y)) != 0:
            c += 1
        print(c,n-c)
Comment

PREVIOUS NEXT
Code Example
Python :: HUNGRY CHEF codechef 
Python :: pyjwt 
Python :: prime numbers python 
Python :: django start app 
Python :: lambda function in python 
Python :: python get cos sim 
Python :: temp python web server 
Python :: pandas filter rows by value 
Python :: python run code at the same time 
Python :: python create file in current directory 
Python :: User serializer in django rest framework 
Python :: pickle save dict 
Python :: create a 2d array in python 
Python :: python qt always on top 
Python :: access myultiple dict values with list pythojn 
Python :: pandas difference between rows in a column 
Python :: no python application found, check your startup logs for errors 
Python :: Highlight Active Links in Django Website 
Python :: pyaduio linux 
Python :: how to return a value from a function in python 
Python :: python list to dict 
Python :: calculate perimeter of rectangle in a class in python 
Python :: django rest framework viewset perform_update 
Python :: pyton count number of character in a word 
Python :: python counter nested dictionary 
Python :: how to set gpu python 
Python :: How can write event for textbox in tkinter 
Python :: selenium python switch tabs 
Python :: use mongo replica set python 
Python :: uses specific version python venv 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =