// ftemp12.cpp: Function template with two parameters
#include <iostream>
using namespace std;

template <class T, class U>
U multsum(T x, T y, U u, int n) {
  return x + y + n*u;
}

int main() {
  cout << multsum(4, 3, 0.5, 5) << endl; // utput 9.5
  return 0;
}
