Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

To Divide or Not To Divide codechef solution

def solution(a,b,n):
    if a%b == 0:
        return -1
    c = n
    if c%a != 0:
        c = n+a-(c%a)
    while not(c%a == 0 and c%b !=0):
        c += a
    return c
for _ in range(int(input())):
    a,b,n = map(int,input().split())
    print(solution(a,b,n))
Comment

PREVIOUS NEXT
Code Example
Python :: To Divide or Not To Divide 
Python :: fastest way to take screenshot python 
Python :: pos taggging in nltk 
Python :: replace in lists py 
Python :: drop dataframe columns 
Python :: python button tkinter change color 
Python :: python requests response 503 
Python :: flask delete from database 
Python :: proper pagination django template 
Python :: python serialize 
Python :: return python meaning 
Python :: print on same line 
Python :: render to response django 
Python :: how to import matplotlib in python 
Python :: normalize function 
Python :: tkinker 
Python :: how to add to a list python 
Python :: éliminer le background image python 
Python :: How do I schedule an email to send at a certain time using cron and smtp, in python 
Python :: dict ;get a key of a value 
Python :: import pycocotools._mask as _mask error Expected 80, got 88 
Python :: where to put capybara default wait time 
Python :: matplotlib remove white lines between contour 
Python :: python enumerate() 
Python :: Making a delete request using python 
Python :: how to customize simplejwt error response message in django restframework 
Python :: how to get ping from computer IN PYTHON 
Python :: Average of total in django querysets 
Python :: how to get module path in python 
Python :: access icloud doc on jupyter notebook 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =