#ifndef MIXEDEXPRESSION_H
#define MIXEDEXPRESSION_H
#include<fstream>
using namespace std;
class MixedExpression
{
private :
long a, b, c; // Variables of the mixed expression.
long GCD( long , long ) ; // Get the greatest common divisor.
void reduce( void ) ; // Reduce a mixed expression to its normal form.
public :
MixedExpression( ) ; // Default constructor of the mixed expression class.
MixedExpression( long , long , long ) ;
MixedExpression add( MixedExpression op) ; // Add two numbers.
MixedExpression subtract( MixedExpression op) ; // Subtract two numbers.
MixedExpression multiply( MixedExpression op) ; // Multiply two numbers.
MixedExpression divide( MixedExpression op) ; // Divide two numbers.
void ReadMixedExp( istream & in) ; // Read each line.
void printData( ostream & out) ; // Print the result.
} ;
#endif
I2lmbmRlZiBNSVhFREVYUFJFU1NJT05fSAojZGVmaW5lIE1JWEVERVhQUkVTU0lPTl9ICiNpbmNsdWRlPGZzdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpjbGFzcyBNaXhlZEV4cHJlc3Npb24KewoJcHJpdmF0ZToKCQlsb25nIGEsIGIsIGM7IC8vIFZhcmlhYmxlcyBvZiB0aGUgbWl4ZWQgZXhwcmVzc2lvbi4KCQlsb25nIEdDRChsb25nLCBsb25nKTsgLy8gR2V0IHRoZSBncmVhdGVzdCBjb21tb24gZGl2aXNvci4KCQl2b2lkIHJlZHVjZSh2b2lkKTsgLy8gUmVkdWNlIGEgbWl4ZWQgZXhwcmVzc2lvbiB0byBpdHMgbm9ybWFsIGZvcm0uCglwdWJsaWM6CgkJTWl4ZWRFeHByZXNzaW9uKCk7IC8vIERlZmF1bHQgY29uc3RydWN0b3Igb2YgdGhlIG1peGVkIGV4cHJlc3Npb24gY2xhc3MuCgkJTWl4ZWRFeHByZXNzaW9uKGxvbmcsIGxvbmcsIGxvbmcpOwoJCU1peGVkRXhwcmVzc2lvbiBhZGQoTWl4ZWRFeHByZXNzaW9uIG9wKTsgLy8gQWRkIHR3byBudW1iZXJzLgoJCU1peGVkRXhwcmVzc2lvbiBzdWJ0cmFj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