// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>
#include <fstream>
#include <cstring>

using namespace std;

int main(int argc,char *argv[])
{
   ifstream f("big.dat", ios::binary);
   char buf[1000000];
   int block = atoi(argv[1]);
   long long offset = block;
   offset = offset * 1000000;
   f.seekg(0, ios_base::beg);
   while(offset > 1000000000)
   {
       f.seekg(1000000000, ios_base::cur);
       offset = offset - 1000000000;
   }
   f.seekg((int)offset, ios_base::cur);
   f.read(buf,sizeof(buf));
   cout << (int)(char)(block % 256) << " " << (int)buf[0] << endl;
   return 0;
}
