2 import java
.util
.Scanner
;
5 * @author Iskander Akishev
6 * @author Vladimir Danilov
8 public class business_ia_vd
implements Runnable
{
10 private static final String FILE_NAME
= "business";
15 } catch (Throwable t
) {
22 private PrintWriter out
;
24 private void solve() throws Exception
{
25 in
= new Scanner(new FileReader(FILE_NAME
+ ".in"));
26 out
= new PrintWriter(new File(FILE_NAME
+ ".out"));
33 for (int i
= 0; i
< m
; i
++) {
38 int mod
= upOnly
% (u
+ d
);
39 res
= Math
.min(res
, mod
== 0 ? u
+ d
: mod
);
49 public static void main(String
[] args
) {
50 new Thread(new business_ia_vd()).start();