Para ver el link del problema Click aqui
Blog dedicado a la publicación de artículos, programas propios, traducciones de Roms de Nes, super Nes y mas, y alguno que otro artículo sobre tecnologia.
Showing posts with label codeforces. Show all posts
Showing posts with label codeforces. Show all posts
Friday, September 26, 2014
Sunday, March 20, 2011
Problema 1A. Theatre Square [Codeforces]
Aqui un problema que resolví de http://www.codeforces.com
Problema 1A. Theatre Square
import java.math.BigInteger;
import java.util.Scanner;
/**
* Problema 1A - Theatre Square [http://www.codeforces.com]
*
* @author BreakDark
* @version 1.1 beta
*/
// ACEPTADO!!! xD
public class Main {
public static void main(String[] args) {
Scanner Lee; // para leer los datos de entrada
int n, m, a; // para las dimensiones n*m y a*a
BigInteger r; // para el resultado final
// AQUI INICIA EL PROGRAMA
Lee = new Scanner(System.in);
while (Lee.hasNext()) {
n = Lee.nextInt();
m = Lee.nextInt();
a = Lee.nextInt();
n = (int) Math.ceil((double) n / a);
m = (int) Math.ceil((double) m / a);
r = new BigInteger(String.valueOf(n));
r = r.multiply(new BigInteger(String.valueOf(m)));
System.out.println(r);
}
}
}
Problema 1A. Theatre Square
import java.math.BigInteger;
import java.util.Scanner;
/**
* Problema 1A - Theatre Square [http://www.codeforces.com]
*
* @author BreakDark
* @version 1.1 beta
*/
// ACEPTADO!!! xD
public class Main {
public static void main(String[] args) {
Scanner Lee; // para leer los datos de entrada
int n, m, a; // para las dimensiones n*m y a*a
BigInteger r; // para el resultado final
// AQUI INICIA EL PROGRAMA
Lee = new Scanner(System.in);
while (Lee.hasNext()) {
n = Lee.nextInt();
m = Lee.nextInt();
a = Lee.nextInt();
n = (int) Math.ceil((double) n / a);
m = (int) Math.ceil((double) m / a);
r = new BigInteger(String.valueOf(n));
r = r.multiply(new BigInteger(String.valueOf(m)));
System.out.println(r);
}
}
}
Subscribe to:
Posts (Atom)