#include <iostream>
using namespace std;
class Frequency
{
public:
void Print() const { cout << hertz << "Hz\n"; }
explicit constexpr Frequency(unsigned int h) : hertz(h) {}
private:
unsigned int hertz;
};
constexpr Frequency operator"" _Hz(unsigned long long hz)
{
return Frequency{hz};
}
constexpr Frequency operator"" _kHz(long double khz)
{
return Frequency{khz * 1000};
}
int main()
{
Frequency(44100_Hz).Print();
Frequency(44.1_kHz).Print();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKCmNsYXNzIEZyZXF1ZW5jeQp7CnB1YmxpYzoKCXZvaWQgUHJpbnQoKSBjb25zdCB7IGNvdXQgPDwgaGVydHogPDwgIkh6XG4iOyB9CgoJZXhwbGljaXQgY29uc3RleHByIEZyZXF1ZW5jeSh1bnNpZ25lZCBpbnQgaCkgOiBoZXJ0eihoKSB7fQpwcml2YXRlOgoJdW5zaWduZWQgaW50IGhlcnR6Owp9Owpjb25zdGV4cHIgRnJlcXVlbmN5IG9wZXJhdG9yIiIgX0h6KHVuc2lnbmVkIGxvbmcgbG9uZyBoeikKewoJcmV0dXJuIEZyZXF1ZW5jeXtoen07Cn0KY29uc3RleHByIEZyZXF1ZW5jeSBvcGVyYXRvciIiIF9rSHoobG9uZyBkb3VibGUga2h6KQp7CglyZXR1cm4gRnJlcXVlbmN5e2toeiAqIDEwMDB9Owp9CgppbnQgbWFpbigpCnsKCUZyZXF1ZW5jeSg0NDEwMF9IeikuUHJpbnQoKTsKCUZyZXF1ZW5jeSg0NC4xX2tIeikuUHJpbnQoKTsKCXJldHVybiAwOwp9