(SPOJ) 10866 - Transporte - Solução
import java.io.*;
import java.util.*;
class Main {
public static void main(String[] args) throws NumberFormatException, IOException {
Main processando = new Main();
processando.processa();
System.exit(0);
}
void processa() throws NumberFormatException, IOException {
String line = "";
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
line = br.readLine();
StringTokenizer tokenizer = new StringTokenizer(line);
int a = Integer.valueOf(tokenizer.nextToken());
int b = Integer.valueOf(tokenizer.nextToken());
int c = Integer.valueOf(tokenizer.nextToken());
line = br.readLine();
tokenizer = new StringTokenizer(line);
int x = Integer.valueOf(tokenizer.nextToken());
int y = Integer.valueOf(tokenizer.nextToken());
int z = Integer.valueOf(tokenizer.nextToken());
long xa = x/a;
long yb = y/b;
int pilha = z/c;
System.out.println(xa*yb*pilha);
return;
}
}
import java.util.*;
class Main {
public static void main(String[] args) throws NumberFormatException, IOException {
Main processando = new Main();
processando.processa();
System.exit(0);
}
void processa() throws NumberFormatException, IOException {
String line = "";
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
line = br.readLine();
StringTokenizer tokenizer = new StringTokenizer(line);
int a = Integer.valueOf(tokenizer.nextToken());
int b = Integer.valueOf(tokenizer.nextToken());
int c = Integer.valueOf(tokenizer.nextToken());
line = br.readLine();
tokenizer = new StringTokenizer(line);
int x = Integer.valueOf(tokenizer.nextToken());
int y = Integer.valueOf(tokenizer.nextToken());
int z = Integer.valueOf(tokenizer.nextToken());
long xa = x/a;
long yb = y/b;
int pilha = z/c;
System.out.println(xa*yb*pilha);
return;
}
}
Comments
Post a Comment