#include <time.h>

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	double duration = 24000.0/1001.0;
	double first_pts = (double)time(NULL);
	unsigned long long nb_frame = 1000000;
	
	double time_after_1 = first_pts + nb_frame * duration;
	double time_after_2 = first_pts;
	for(unsigned long long i = 0 ; i < nb_frame ; ++i)
	{
		time_after_2 += duration;
	}
	
	double time_after_3 = first_pts;
	double c = 0.0;             // A running compensation for lost low-order bits.
    for(unsigned long long i = 0 ; i < nb_frame ; ++i)
    {
    	double y = duration - c;    // So far, so good: c is zero.
        double t = time_after_3 + y;          // Alas, sum is big, y small, so low-order digits of y are lost.
        c = (t - time_after_3) - y; // (t - sum) recovers the high-order part of y; subtracting y recovers -(low part of y)
        time_after_3 = t;           // Algebraically, c should always be zero. Beware overly-aggressive optimizing compilers!
        // Next time around, the lost low part will be added to y in a fresh attempt.
    }
	cout << time_after_1 - time_after_2 << " or " << time_after_1 - time_after_3 << endl;
	
	return 0;
}