#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "gmp.h"


int main
(
   int   iArgs    ,
   char *apsArgs[]
)
{
   FILE        *pF        = NULL;
   char        *pcArgF    = NULL;
   int          i         = 0;
   mpz_t        mA;
   mpz_t        mB;

   for (i = 0; i < iArgs; i++)
   {
      if (0 == strncmp ("-a=", apsArgs[i], 3))         // -a
      {
         pcArgF = apsArgs[i] + 3;

         pF = fopen (pcArgF,"r");
         if (NULL == pF)
            exit (printf ("fopen(%s) failed", pcArgF));

         mpz_init (mA);
         gmp_fscanf (pF, "%Zd", mA);
         fclose (pF);
      }
      else
      if (0 == strncmp ("-b=", apsArgs[i], 3))         // -a
      {
         pcArgF = apsArgs[i] + 3;

         pF = fopen (pcArgF,"r");
         if (NULL == pF)
            exit (printf ("fopen(%s) failed", pcArgF));

         mpz_init (mB);
         gmp_fscanf (pF, "%Zd", mB);
         fclose (pF);
      }
   }


   mpz_t mDiff;

   mpz_init (mDiff);
   mpz_sub (mDiff, mB, mA);
   gmp_printf ("%Zd\n", mDiff);

   mpz_clear (mDiff);
   mpz_clear (mA);
   mpz_clear (mB);

   return (0);
}
