Code for problem "Triangle".