blob: 34484843c032702e0a506177fbf58969a87fe79f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import java.io.*;
class bits {
public static void main(String args[]) throws Exception {
StreamTokenizer st = new StreamTokenizer(System.in);
int i, j, n, max, inst=0;
while(42==42) {
st.nextToken();
n = (int) st.nval;
if(n==0) break;
max=1;
for(i=0; i<n; i++) {
st.nextToken();
j = (int) st.nval;
if(j>max) max=j;
}
for(i=0; max>0; i++)
max >>= 1;
inst++;
System.out.println("Instancia " + inst);
System.out.println(i*n + "\n");
}
}
}
|