// Kwaterniony
// PROI - ZAD 1
#include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
class Quaternion
{
//Obiekty bedace wspolczynnikami kwaternionu w postaci algebraicznej:
int Afactor;
int Bfactor;
int Cfactor;
int Dfactor;
public :
//Konstruktor:
Quaternion( int a, int b, int c, int d) ;
//Destruktor
~Quaternion( ) { }
//Przeciazanie operatorów:
Quaternion operator+ ( Quaternion & q) ;
Quaternion & operator+ = ( Quaternion & q) ;
Quaternion operator- ( Quaternion & q) ;
Quaternion & operator- = ( Quaternion & q) ;
Quaternion operator* ( Quaternion & q) ;
Quaternion & operator* = ( Quaternion & q) ;
friend ostream & operator<< ( ostream & strm, Quaternion & q) ;
double module( ) ;
} ;
Ly8gS3dhdGVybmlvbnkKLy8gUFJPSSAtIFpBRCAxCiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDxjbWF0aD4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpjbGFzcyBRdWF0ZXJuaW9uCnsKICAgICAgICAvL09iaWVrdHkgYmVkYWNlIHdzcG9sY3p5bm5pa2FtaSBrd2F0ZXJuaW9udSB3IHBvc3RhY2kgYWxnZWJyYWljem5lajoKICAgICAgICBpbnQgQWZhY3RvcjsKICAgICAgICBpbnQgQmZhY3RvcjsKICAgICAgICBpbnQgQ2ZhY3RvcjsKICAgICAgICBpbnQgRGZhY3RvcjsKICAgIHB1YmxpYzoKICAgICAgICAvL0tvbnN0cnVrdG9yOgogICAgICAgIFF1YXRlcm5pb24oaW50IGEsIGludCBiLCBpbnQgYywgaW50IGQpOwogICAgICAgIC8vRGVzdHJ1a3RvcgogICAgICAgIH5RdWF0ZXJuaW9uKCl7fQogICAgICAgIC8vUHJ6ZWNpYXphbmllIG9wZXJhdG9yw7N3OgogICAgICAgIFF1YXRlcm5pb24gb3BlcmF0b3IrKFF1YXRlcm5pb24gJnEpOwogICAgICAgIFF1YXRlcm5pb24gJiBvc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