gcd problem

Правка en1, от ghost9, 2020-04-10 22:37:04

You are provided with coins of denominations "a" and "b". You are required to find the least value of n, such that all currency values greater than or equal to n can be made using any number of coins of denomination "a" and "b" and in any order. If no such number exists, print "-1" in that case. how can i solve this question ?

Теги #gcd, #basic math, #codechef

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ghost9 2020-04-10 22:37:04 341 Initial revision (published)