#include <iostream>
#ifdef __BORLANDC__
#include <math>
#else
#include <cmath>
  using namespace std;
#endif

template<typename Typ> Typ Min(Typ a,Typ b) { return(a<b?a:b); }

class Unsigned
  {
   private:
   unsigned x;
   public:
   Unsigned(unsigned x):x(x) {}
   bool operator<(const Unsigned &U)const { return(x<U.x); }
  };

template<typename Typ> class Punkt
  {
   public:
   Typ x,y;
   Punkt():x(0),y(0) {}
   Punkt(Typ x,Typ y):x(x),y(y) {}
   Punkt(const Punkt &P);
   ~Punkt();
   double Odleglosc(Typ x,Typ y);
  };

template<typename Typ> Punkt<Typ>::Punkt(const Punkt<Typ> &P):x(P.x),y(P.y)
  {
  }

template<typename Typ> Punkt<Typ>::~Punkt()
  {
  }

template<typename Typ> double Punkt<Typ>::Odleglosc(Typ x,Typ y)
  {
   x-=this->x;
   y-=this->y;
   return(sqrt((double)(x*x+y*y)));
  }

int main()
  {
   int a1=3,b1=4,c1=Min(a1,b1);
   double a2=3,b2=4,c2=Min(a2,b2);
   Unsigned a3=3,b3=4,c3=Min(a3,b3);

   Punkt<double> Pd(3.5,4.5);
   Punkt<int> Pi(3,4);
   cout<<Pd.Odleglosc(0,0)<<endl;
   cout<<Pi.Odleglosc(0,0)<<endl;

#ifdef __BORLANDC__
   cin.get();
#endif
   return(0);
  }
