blob: 32a708fc0a76ce8ffc262b9a6cc83981047c9035 (
plain) (
tree)
|
|
import java.util.*;
public class Plo{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long visina = sc.nextInt();
long sirina = sc.nextInt();
long k = sc.nextInt();
long stPloscic = (visina/(1 << k))*(sirina/(1 << k));
for (long i = k - 1; i >= 0; i--) {
if ((sirina & (1 << i)) > 0)
stPloscic += (visina / (1 << i));
if ((visina & (1 << i)) > 0)
stPloscic += (sirina / (1 << i));
if ((sirina & (1 << i)) > 0 && (visina & (1 << i)) > 0)
stPloscic--;
}
System.out.println(stPloscic);
}
}
|