Mittal finds <3
All submissions for this problem are available.Mittal's crush proposed him recently. Hence, Mittal's friends are now asking for a treat. Upon much persuasion, he finally agreed to host a Burger treat. Mittal is fond of cooking, so he decided to cook burgers himself. But since Mittal is also saving up to buy an expensive gift for his new girlfriend, he wants to spend as little as possible for the treat. Mittal's friends are willing to share any amount of burger Mittal makes (that is the number of burgers Mittal makes is independent of number of friends). Mittal went to the supermarket to buy cheese slices and buns for burgers. Cheese slices are sold $N$ in a packet and buns $M$ in a packet(buying fractions of packets is not allowed by the supermarket, that is one has to buy the packets as a whole). Mittal wants to minimize the number of burgers he makes, (but he doesn't like wastage too, so he uses all the cheese slices and buns he buys to make burgers). He buys the cheese and bun packets accordingly. Find the minimum number of burgers Mittal can make. Note that each burger uses only 1 cheese slice and 1 bun. ###Input: The only line of input contains two integers $N$ and $M$ denoting the number of cheese slices in a packet and the number of buns in a packet respectively. ###Output: Output a single line integer denoting the minimum number of burgers Mittal can make according to the conditions given in the problem. ###Constraints - $1 \leq N, M \leq 10^9$ ###Subtasks - 30 points : $1 \leq N, M \leq 10^5$ - 70 points : Original Constraints ###Sample Input: 2 3 ###Sample Output: 6 ###Explanation: Mittal can buy 3 packets of cheese slices and 2 packets of buns, this gives him a total of 6 cheese slices and 6 buns each. So he can make burgers. Prepared by : [Satyanand](https://www.codechef.com/users/arch_abs)
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.