#include <iostream>
#include <algorithm>
#include <tuple>
int main() {
int a, b;
a = 6;
b = 5;
auto p = std::minmax(a, b);
std::cout << "p.first = " << p.first << std::endl;
std::cout << "p.second = " << p.second << std::endl;
a = 5;
b = 6;
std::tie(b, a) = std::minmax(a, b);
std::cout << "a = " << a << std::endl;
std::cout << "b = " << b << std::endl;
a = 5;
b = 6;
std::tie(b, a) = std::minmax({a, b});
std::cout << "a = " << a << std::endl;
std::cout << "b = " << b << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8dHVwbGU+CgppbnQgbWFpbigpIHsKICAgIGludCBhLCBiOwogICAgCiAgICBhID0gNjsKICAgIGIgPSA1OwogICAgCiAgICBhdXRvIHAgPSBzdGQ6Om1pbm1heChhLCBiKTsKICAgIHN0ZDo6Y291dCA8PCAicC5maXJzdCA9ICIgPDwgcC5maXJzdCA8PCBzdGQ6OmVuZGw7CiAgICBzdGQ6OmNvdXQgPDwgInAuc2Vjb25kID0gIiA8PCBwLnNlY29uZCA8PCBzdGQ6OmVuZGw7CiAgICAKICAgIGEgPSA1OwogICAgYiA9IDY7CiAgICAKICAgIHN0ZDo6dGllKGIsIGEpID0gc3RkOjptaW5tYXgoYSwgYik7CiAgICAKICAgIHN0ZDo6Y291dCA8PCAiYSA9ICIgPDwgYSA8PCBzdGQ6OmVuZGw7CiAgICBzdGQ6OmNvdXQgPDwgImIgPSAiIDw8IGIgPDwgc3RkOjplbmRsOwogICAgCiAgICBhID0gNTsKICAgIGIgPSA2OwogICAgCiAgICBzdGQ6OnRpZShiLCBhKSA9IHN0ZDo6bWlubWF4KHthLCBifSk7CiAgICAKICAgIHN0ZDo6Y291dCA8PCAiYSA9ICIgPDwgYSA8PCBzdGQ6OmVuZGw7CiAgICBzdGQ6OmNvdXQgPDwgImIgPSAiIDw8IGIgPDwgc3RkOjplbmRsOwp9Cg==