Find Maximum and Minimum element in a Set in C++ STL

Given a Set, the task is to find the maximum and minimum element of this set in C++ STL.

Examples:

Input: set={1, 6, 15, 10, 5}
Output: max = 15, min = 1

Input: set={10, 20, 30, 40, 50, 60}
Output: max = 60, min = 10