#include <stdio.h> 
/* Define the trade apparatus */
struct trade {double price; int number;};
struct trade *trade_pointers[100];
enum {bad_size_bit = 1, bad_price_bit  = 2,
      too_much_bit = 4, too_little_bit = 8};
main ( ) {
  /* Declare various variables */
  int limit, counter, number;
  double price, sum = 0.0;
  /* Declare status byte */
  unsigned char status = 0;
  /* Read trade information */
  for (limit = 0;
       2 == scanf ("%lf%i", &price, &number) && limit < 100;
       ++limit)
    if (price > 0.0 && number > 0) {
      trade_pointers[limit] 
        = (struct trade*) malloc (sizeof (struct trade));
      trade_pointers[limit] -> price = price;
      trade_pointers[limit] -> number = number;
    }
    else {
      if (price <= 0.0) {status = status | bad_price_bit;}
      if (number <= 0) {status = status | bad_size_bit;}
    }
  if (limit < 10) status = status | too_little_bit;
  else if (limit == 100) status = status | too_much_bit;
  /* Check status variable */
  if (status & (bad_price_bit | bad_size_bit))
    printf ("Bad data were encountered and ignored.\n", status);
  if (status & (too_little_bit | too_much_bit))
    printf ("Wrong number of data were encountered.\n", status);
}
