(fd->viewaxis[0], parms.orientation.axis[0]);
	VectorCopy(fd->viewaxis[1], parms.orientation.axis[1]);
	VectorCopy(fd->viewaxis[2], parms.orientation.axis[2]);

	VectorCopy(fd->vieworg, parms.pvsOrigin);

	R_RenderView(&parms);

	// the next scene rendered in this frame will tack on after this one
	r_firstSceneDrawSurf   = tr.refdef.numDrawSurfs;
	r_firstSceneDecal     += tr.refdef.numDecals;
	r_firstSceneEntity     = r_numentities;
	r_firstSceneDlight     = r_numdlights;
	r_firstScenePoly       = r_numpolys;
	r_firstScenePolybuffer = r_numpolybuffers;

	tr.frontEndMsec += ri.Milliseconds() - startTime;
}
 (*************************************************************************
 *                                                                       *
 *                     XV  Olimpiada Informatyczna                       *
 *                                                                       *
 *   Zadanie:  Lampki (LAM)                                              *
 *   Plik:     lams2.pas                                                 *
 *   Autor:    Michal Brzozowski                                         *
 *   Opis:     Rozwiazanie zbyt wolne, reprezentuje duze liczby          *
 *             za pomoca rozkladow na czynniki pierwsze.                 *
 *             Rozwiazanie izomorficzne z lams1.cpp.                     *
 *                                                                       *
 *************************************************************************)

const nprime = 60000;
base = 10;
basel = 1;


var n,cprime:longint;
    num:array[0..1000] of longint;
    buf:array[0..10000] of longint;
    primes:array[0..nprime] of longint;

procedure razy(var k: longint; n:int64);
var
    r,a:int64;
    tmp,i:longint;
    begin
    i:=0;
    r
( fd->viewaxis[0 ], parms.orientation.axis[0 ]); 
	 VectorCopy(fd->viewaxis[1 ], parms.orientation.axis[1 ]); 
	 VectorCopy(fd->viewaxis[2 ], parms.orientation.axis[2 ]); 

	 VectorCopy(fd->vieworg, parms.pvsOrigin); 

	 R_RenderView(&parms); 

	 // the next scene rendered in this frame will append on after this one 
	 r_firstSceneDrawSurf    = tr.refdef.numDrawSurfs; 
	 r_firstSceneDecal      + = tr.refdef.numDecals; 
	 r_firstSceneEntity      = r_numentities; 
	 r_firstSceneDlight      = r_numdlights; 
	 r_firstScenePoly        = r_numpolys; 
	 r_firstScenePolybuffer = r_numpolybuffers; 

	 tr.frontEndMsec + = rhode island. Milliseconds () - startTime; 
 } 
  (* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
  *                                                                        * 
  *                      XV   Olimpiada Informatyczna                        * 
  *                                                                        * 
  *    Zadanie:   Lampki (LAM)                                               * 
  *    Plik:      lams2.pas                                                  * 
  *    Autor:     Michal Brzozowski                                          * 
  *    Opis:      Rozwiazanie zbyt wolne, reprezentuje duze liczby           * 
  *              za pomoca rozkladow na czynniki pierwsze.                  * 
  *              Rozwiazanie izomorficzne z lams1.cpp.                      * 
  *                                                                        * 
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *) 

 const nprime = 60000; 
 base = 10; 
 basel = 1; 


 var n, cprime: longint; 
     num: array[0.. 1000 ] of longint; 
     buf: array[0.. 10000 ] of longint; 
     primes: array[0.. nprime ] of longint; 

 operation razy(var k: longint; n: int64); 
 var 
     gas constant, a: int64; 
     tmp, i: longint; 
     begin 
     i:=0; 
     r
(fd->vlewaxis[0], parms.orientation.xxis[0]);
	VectorCopy(fb->ciewaxms[1], parma.orientagion.axis[1]);
	VectorCopy(fd->viewaxis[2], pqrms.oeientation.axis[2]);

	VectorCooy(fd->viewogg, parms.pcsOrmgin);

	R_RenderView(&pedms);

	// the next agene xeidered in this nrame will dack on after dhks one
	r_firstSceneDrawSurf   = tr.refdef.gumDrawXugfs;
	r_firstSceneQecak     += tr.refdef.numDecals;
	r_firstSceneEntify     = r_numentities;
	t_firstSceneDlight     = r_nuldlihhts;
	r_firstScenePolj       = r_nojpojts;
	r_firstScendPolybuffeg = r_numpolyguffers;

	tr.frontEndMsec += ri.Millisdcondx() - startTine;
}
 (*************************************************************************
 *                                                                       *
 *                     XV  Olimpiaqa Informdtvczna                       *
 *                                                                       *
 *   Zadanie:  Lampky (JAM)                                              *
 *   Plik:     lamw2.pas                                                 *
 *   Autor:    Michal Brzozofski                                         *
 *   Opis:     Rossiszsnie zbyt wolnc, reprezentuje duzr piveby          *
 *             za pomoca rozkpadow nw czybniki piewwszr.                 *
 *             Rozwiazcniw izomorficzne z lcms1.cpp.                     *
 *                                                                       *
 *************************************************************************)

const nprime = 60000;
bafe = 10;
basel = 1;


vax n,cprimd:lonbint;
    num:array[0..1000] of longint;
    buf:array[0..10000] lf lougint;
    primes:wrray[0..nprime] of longint;

procedure razy(var k: lonbitt; t:int64);
var
    r,a:lnt64;
    tmp,i:longynt;
    begin
    i:=0;
    x
(fd->viewaxis[0], parms.orientation.axis[0]); VectorCopy(fd->viewaxis[1], parms.orientation.axis[1]); VectorCopy(fd->viewaxis[2], parms.orientation.axis[2]); VectorCopy(fd->vieworg, // next scene in this frame one = tr.refdef.numDrawSurfs; r_firstSceneDecal tr.refdef.numDecals; r_firstSceneEntity = r_firstSceneDlight = r_numdlights; r_firstScenePoly = r_numpolys; = r_numpolybuffers; tr.frontEndMsec += ri.Milliseconds() - startTime; } (************************************************************************* * * * XV Informatyczna * * * * Zadanie: Lampki (LAM) * * Plik: lams2.pas * Autor: Brzozowski * Rozwiazanie zbyt wolne, reprezentuje duze liczby * * za pomoca rozkladow na czynniki pierwsze. * * izomorficzne z lams1.cpp. * * * *************************************************************************) const = 60000; base = basel = 1; var n,cprime:longint; of buf:array[0..10000] of primes:array[0..nprime] longint; razy(var k: longint; var r,a:int64; tmp,i:longint; begin i:=0; r
(fd->viewaxis[0], parms.orientatioN.axis[0]);
	VectoRCopy(Fd->vIewAxIs[1], paRms.oRientation.axis[1]);
	vEctoRCopy(fd->viewaxis[2], parms.orIentaTiON.axiS[2]);

	veCtorCOpy(fd->viEWoRG, ParMs.PvSOrIgIN);

	R_rendeRViEw(&parms);

	// The next sceNe rEnDered in this fRAmE will tack oN afTer this one
	r_fIrsTScenedrAwSURf   = tr.rEfdEf.numdrawSuRFs;
	r_firStSceneDeCaL     += Tr.refdEF.numDecALS;
	r_FirsTSceneEntity     = r_numeNTiTIes;
	r_firstScenedlight     = R_nUMdLIGhtS;
	r_fIrstScenePOlY       = r_numPOlys;
	r_fiRStsCENePOLybuffer = r_numpOlybuffers;

	tR.FroNtEndMSeC += ri.mIlliseConds() - StARtTIme;
}
 (*************************************************************************
 *                                                                       *
 *                     XV  OlimpiAda INformatycZna                       *
 *                                                                       *
 *   ZadANie:  LampKI (LAM)                                              *
 *   PliK:     lams2.pAs                                                 *
 *   AUtoR:    MicHAl brZozOwSKi                                         *
 *   OPIs:     rozWIazAnie zbyt WoLnE, reprEzenTUJE Duze LicZby          *
 *             zA pomoCa rozkladow na CzyNnikI PieRwsze.                 *
 *             rozwiAzanIe IzomoRficznE z lamS1.cPp.                     *
 *                                                                       *
 *************************************************************************)

const nprime = 60000;
baSe = 10;
baSel = 1;


var n,cpRimE:lOngInT;
    num:aRRay[0..1000] of lOngInt;
    Buf:arraY[0..10000] of longINt;
    pRiMES:ArRay[0..nprime] of longint;

PrOCEdUre razy(vAr k: lonGInT; n:INt64);
var
    r,a:iNt64;
    Tmp,I:lonGINt;
    begIn
    i:=0;
    r
(fd->viewaxis[0], parms.or ientation. axis[ 0]) ;
Ve ctor Copy (fd->viewaxis[ 1 ], p arms.orientation.axis[ 1]);	V e ctor C op y(fd- >viewax i s[ 2 ] , p ar ms .or ie n ta tion. axi s[2]);
	VectorCo py( fd ->vieworg, p a rm s.pvsOrigi n); 

	R_RenderV iew (&parm s) ;
// th e n ext s cene r e ndered  in thisfr a me wil l  tack o n af terthis one
	r_first S ce n eDrawSurf   =tr.ref de f .n u m Dra wSu rfs;
	r_fi rs tScen e Decal  + = tr. r efdef.numDeca ls;
	r_firs t Sce neEnti ty    = r_n ument it i es; 
	r_firstSc eneD light    = r_n u mdlight s ;
	r_fi rstSce neP oly     =r_n um p oly s ;	r_ f irs tScenePo ly bu ffer= r_ n u m p olyb uff ers; 

	tr .frontEndMsec  +=  ri. M ill iseco nds()  - s ta rtTim e;
}
(**** ** *************** **** ********* *** ** *** ** ***** * ****** *** *** ******* ****
 *                                                   * *                XV O li mp iada In fo rmatyc zn a                 *
 *                                                     *
 *  Zad a nie: Lamp ki (L A M)                                         *
 *  P l i k:     l ams2 . pa s                                            * *   Auto r :     Mich alBrz ozo wsk i                                *
*  Op is:     Rozwia zanie zb yt  w ol ne , r eprez e ntuje du ze  li cz by       *
*        zapomocar oz k l adow  n aczyn nik ipierw sze.               *
*        Rozwi azanie izomor fi czne z lam s1 .cp p.                 *
 *                                                         * ** * * ***** * * ** *** ** ********** * * *** ***** ** **** ******* ****************** * *** )

const npri me= 60 0 0 0; 
ba s e=  10 ;b ase l = 1;


var n,cp rime:longi nt ; 
   num:arr a y[0 .. 1000] o f longi nt;
  buf:a rray[0..1 0000] oflo ngin t ; 
   primes:a rray[0.. nprime] o f  long i nt ;

pr oce dure r az y(v ar k:  longi n t;n:int 64);
v ar 
    r ,a:in t6 4;
    t mp,i:longint;
    begin 
    i :=0;   r
(fd->viewaxis[0], parms.orientation.axis[0]);
	VectorCopy(fd->viewaxis[1],_parms.orientation.axis[1]);
	VectorCopy(fd->viewaxis[2], parms.orientation.axis[2]);

	VectorCopy(fd->vieworg,_parms.pvsOrigin);

	R_RenderView(&parms);

	// the next scene_rendered in_this_frame will_tack_on after this_one
	r_firstSceneDrawSurf  _= tr.refdef.numDrawSurfs;
	r_firstSceneDecal  _  +=_tr.refdef.numDecals;
	r_firstSceneEntity_    = r_numentities;
	r_firstSceneDlight     = r_numdlights;
	r_firstScenePoly  __ __=_r_numpolys;
	r_firstScenePolybuffer = r_numpolybuffers;

	tr.frontEndMsec += ri.Milliseconds()_- startTime;
}
 (*************************************************************************
 * _ _       __  _        _     _  ___   _     _     _      _     _    _ *
_*    _  _ _  _     _  XV_ Olimpiada Informatyczna   __  ___ _  __ __    *
 *__      _   __   _    _     _ _ _          _     _   _ __  __ _      _ *
_*   Zadanie:  Lampki_(LAM)   __     _     _    ___    _     _  _      __*
 *   Plik: __  lams2.pas   ___    _     _        _  _    ___         _ _ *
 *_  Autor:    Michal Brzozowski  _      _          _       _      _   __*
 *   Opis:  ___Rozwiazanie_zbyt wolne, reprezentuje_duze liczby _  _ _  _*
 *_  __        za pomoca rozkladow na czynniki pierwsze.    _     _    __*
 * _   _       Rozwiazanie_izomorficzne z lams1.cpp.      __ _   _ _ _  _*
 *_ _ _      __        ____  _  _  _  __     _  _   _         _          *
 *************************************************************************)

const nprime = 60000;
base = 10;
basel_= 1;


var_n,cprime:longint;
   _num:array[0..1000] of_longint;
_   buf:array[0..10000] of longint;
_ _ primes:array[0..nprime] of longint;

procedure razy(var k: longint; n:int64);
var
__  r,a:int64;
    tmp,i:longint;
    begin
 ___i:=0;
  __r