1 import java
.io
.BufferedReader
;
2 import java
.io
.FileReader
;
3 import java
.io
.PrintWriter
;
4 import java
.io
.IOException
;
5 import java
.util
.StringTokenizer
;
7 public class business_petr
implements Runnable
{
8 private void solve() throws IOException
{
11 int res
= Integer
.MAX_VALUE
;
12 for (int i
= 0; i
< m
; ++i
) {
19 int z
= mm
* u
- (n
- mm
) * d
;
22 res
= Math
.min(res
, z
);
32 public static void main(String
[] args
) throws InterruptedException
{
33 Thread thread
= new Thread(new business_petr());
38 static final String TASK_ID
= "business";
39 static final String IN_FILE
= TASK_ID
+ ".in";
40 static final String OUT_FILE
= TASK_ID
+ ".out";
41 BufferedReader reader
;
42 StringTokenizer tokenizer
;
47 reader
= new BufferedReader(new FileReader(IN_FILE
));
49 writer
= new PrintWriter(OUT_FILE
);
53 } catch (Exception e
) {
59 int nextInt() throws IOException
{
60 return Integer
.parseInt(nextToken());
63 long nextLong() throws IOException
{
64 return Long
.parseLong(nextToken());
67 double nextDouble() throws IOException
{
68 return Double
.parseDouble(nextToken());
71 String
nextToken() throws IOException
{
72 while (tokenizer
== null || !tokenizer
.hasMoreTokens()) {
73 tokenizer
= new StringTokenizer(reader
.readLine());
75 return tokenizer
.nextToken();