aboutsummaryrefslogtreecommitdiff
path: root/doc/tests/fontes/bits-yes.c
blob: ab23f83a249764317b8121f32c95b14f34eaab6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
int main(void) {
  int i, j, n, max, inst=0;
  while(42) {
    scanf("%d", &n);
    if(!n) break;
    max=1;
    for(i=0; i<n; i++) {
      scanf("%d", &j);
      if(j>max) max=j;
    }
    for(i=0; max>0; i++)
      max >>= 1;
    printf("Instancia %d\n%d\n\n", ++inst, i*n);
  }
  return 0;
}