[Question]
  [
In the US, clothing size sometimes has rough designations like M, L, XXL, etc. The US designation of the "men's jacket" category depends on the height of the person. So, in this challenge, you should implement this conversion, which is defined by the following table, taken from [this site](https://www.blitzresults.com/en/mens-clothing-sizes/):
```
US size Body height (cm)
XXXS    160 - 164
XXS     162 - 166
XS      166 - 170
S       168 - 173
M       171 - 176
L       174 - 182
XL      180 - 186
XXL     184 - 189
3XL     187 - 193
4XL     191 - 194
5XL     193 - 198
6XL     197 - 200
```
\* I chose the "men's jacket" category from there because it has the most variability
### Input
Body height, in cm. As a number or a string.
### Output
Size designation - as a return value or printed.
### Additional rules
* For some sizes, designation is uncertain (e.g. 174, 175 and 176 correspond to both M and L) - your converter should return one of these, deterministically or not
* If it's easier, output fully spelled versions like XXXXL instead of 4XL; however, 2XL and 2XS are invalid (apparently they are used in real life, but I decided to forbid them because I thought they weren't)
* Assume the input is valid, i.e. a whole number between 160 and 200
  
[Answer]
# [Python 2](https://docs.python.org/2/), ~~58~~ ~~55~~ ~~52~~ ~~49~~ ~~47~~ 45 bytes
-13 bytes with great contributions from [Arnauld](https://codegolf.stackexchange.com/users/58563/arnauld) (thanks!!!), [xnor](https://codegolf.stackexchange.com/users/20260/xnor) and [xash](https://codegolf.stackexchange.com/users/95594/xash).  
Switched from Python 3 to Python 2 for an extra 2 bytes.
Tried to profit from the overlapping regions. You don't even need a size M, because the sizes of S and L don't have a gap between them. Luckily, the number of X's for S and L can be expressed as a linear integer expression.
```
lambda h:max(173-h>>2,h/3-60)*'X'+'SL'[h>173]
```
[Try it online!](https://tio.run/##bdDNbsIwDADgO09hTkm2wJoU9QctvABsHNih0sahE@1SiRbUdNIY4tk7J6WskxapUvTZsV0fT40@VLLN1Vu7T8v3XQp6XqZfVIT@RC8WkusHfxJ47I4k5J5sVuRVLzC2bU3xnRl1HgEeKgKPi2DG5kCSJNkQ3rNEDjoeaMBF6DkdYIToW/y1UKC550@EA/Q64yKSVlcDjXCCqGv1h21y3E1gveeQi9i/zru6NYyxYdz/xtB99Kj3YSDk0vNuARe5jEb5oQYNRQV1Wn1kbj3g8tyzIoe0OlHcpNICrzvQj0pLd8upZkoZsBWoFhy0ZByMreU2Pi2arDSUba@17Kkz87lvQAFZL4nTbG@y/@LP6xdYL8fjcZd2rIuqAZLT84Vh@HyZ40em2LtMG6q5m4Zf37P2Bw "Python 2 – Try It Online")
Just for fun (and for educational purposes) the original 58 bytes submission:
```
lambda h:(-h+173)//4*'X'+'S'if h<174else(h-180)//3*'X'+'L'
```
[Answer]
# JavaScript (ES8), 50 bytes
This version is derived from [the method used in Python by agtoever](https://codegolf.stackexchange.com/a/214807/58563).
```
n=>'SL'[q=n/87>>1].padStart(q?n/3-59:177-n>>2,'X')
```
[Try it online!](https://tio.run/##VdFLj4IwEADgO79iQoy08cXDpaCCJ0/rxgQuREIi8bHZjSmKZi@E385OafHRQ9P2S2em09/8L7/ty5/LfcSLw7E5BQ0PQiNeG@k14BOPhaGVjS/5Ib7n5Z1cl3zijD78mcXYiIehPTQSgzbxFgKoNAA9SZJYBxwzSMFyzSFOU8iG0iQps4W5nSlS5qIxU1lHyjxhjrKvN2OWsC7m@t2maJ7d5Vu/5vNEnd6jlg6ltff8hymUxtB852kSW/NFLf70xVqU5gjzXk2gNIxpm/h2rZ5r2qkoCcfmYivnwGERCMPVYEDbhu8LfivOx/G5@Ca7XsVr6FWkPN7wyolwSsXXrfiBMFoD6VXxNkXMoN/HYGEAap@a6mjxPLIyWIK@@RRl6aso2kR6TXd0rtXNPw "JavaScript (Node.js) – Try It Online")
---
# JavaScript (ES6), 61 bytes
```
n=>'6543X LMS X3'[i=59-n/3.4|0].trim()+(i<6?'XL':i>8?'XS':'')
```
[Try it online!](https://tio.run/##RdDBjoIwEAbgO08xIca2UVm0iICgJ0@LMZELkZBoVDZs3GLA7IXl2dmpFrmQ8k37Tzvfp99TdS7z@2Miisu1zYJWBCtizy0eQ7iNIOYkyYO5OxEf3LD@zNR4lPkPZSOa@/aaxCHx8pWDi4h4hLA2OkAAtQag8zjSwYMEprY5xo8F6Vh63PtMut05snIbfWEql6zckc6Vb9@@mErvcsLeLXRn1uWHXb4j7@O8@8rCy5/7XeW89wW62/W13u7Kvm73rnnvXLqj3O4dc2YmvktrlpqWFSUVOCwczxIE@IGs4Wo0Ys8BngtRFbercSu@6HFQiwYGNS2vFR7JqGDMuJ8uG3GhFmuADurokGAxheEQw1YBqP/EVOT3NE1hDfruU15L3@z3u73esCNbak37Dw "JavaScript (Node.js) – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 82 bytes
```
lambda x:"3XXSMLXX3456XXS   LXXXXXSS     LLLLL"[~-x/3-53-x/177-x/189+(x==195)::12]
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUaHCSsk4IiLY1yciwtjE1AzIVFBQAHKAIBjEBHJAQCm6TrdC31jX1BhIGZqbg0gLS22NCltbQ0tTTSsrQ6PY/2n5RQqZCpl5CkWJeempGoZmBjoKRgaGmlZcnAVFmXklCpk6CmkamZr/AQ "Python 2 – Try It Online")
-2 bytes thanks to ovs
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), 36 bytes
```
{"XSL"(&0|(-4!x)|-3!-7-x),1+0>x}173-
```
[Try it online!](https://ngn.codeberg.page/k/#eJytT01rg0AQve+vGCUkijF1o3HV0NJT6cGevAhNYYXoZiHRoEbM13/vxBgKuYSWwr43wzLvzZssOKpxFKra0DpppqO0+sm0FZOZrT6mhvXSnimzTUJEcBrwKI7jCyH4Bw95GOOzETOE+6rRmW8s2MJzPZ9SXx8RklXykFYBR2HEO0Q86rQxvg5X6vlW4pCIR1LVjkOVq07Hs45dZLKR+Xsqxap+K8oIPQLqWkDdKcJFeEAZRThAPfz3LpUB9fHPtxGMbJL23sC5ihkKGA4x7D009C7V74U443swtSzSZMH1cMXQ7tPM79110ohA/GKclFZgaNlIzuXlNENxqE4Gn8On47F93p8Ow/Y82Y+bDPgAu1FpEVCzAJL1Gopdvd3VFSRlCk2ylkvo9kJWlLDqtlR4qDWZ4BVqL6thnSZVDUWe9nqQ6JCDzH8sOod6lcK2LBq5TJe9nfqFaTExxcTiUWJxS0xxtfhbYvEfiSn5BpLj8Sg=)
Adapted by @ngn from [@agtoever's python golf](https://codegolf.stackexchange.com/a/214807/98547).
# [K (ngn/k)](https://codeberg.org/ngn/k), 51 bytes
```
|$`SXXX`SXX`SX`M`L`LX`LX3`LX5`LX6@(159+\7\8689119)'
```
[Try it online!](https://ngn.codeberg.page/k/#eJytT01rg0AQve+vGCUkijF1o3HV0NJT6cGevAhNYYXoZiHRoEbM13/vxBgKuYSWwr43wzLvzZssOKpxFKra0DpppqO0+sm0FZOZrT6mhvXSnimzTUJEcBrwKI7jCyH4Bw95GOOzETOE+6rRmW8s2MJzPZ9SXx8RklXykFYBR2HEO0Q86rQxvg5X6vlW4pCIR1LVjkOVq07Hs45dZLKR+Xsqxap+K8oIPQLqWkDdKcJFeEAZRThAPfz3LpUB9fHPtxGMbJL23sC5ihkKGA4x7D009C7V74U443swtSzSZMH1cMXQ7tPM79110ohA/GKclFZgaNlIzuXlNENxqE4Gn8On47F93p8Ow/Y82Y+bDPgAu1FpEVCzAJL1Gopdvd3VFSRlCk2ylkvo9kJWlLDqtlR4qDWZ4BVqL6thnSZVDUWe9nqQ6JCDzH8sOod6lcK2LBq5TJe9nfqFaTExxcTiUWJxS0xxtfhbYvEfiSn5BpLj8Sg=)
`bin`s the input, using a reduced subset of the available sizes to reduce the byte count.
* `(...)'` run a binary lookup of the (implicitly provided) height against the list of heights; this returns the index of the first value equal to or larger than the input
* `(159+\7\8689119)` a compressed version of `160 163 166 171 177 183 187 193 198`
* ``SXXX`SXX`SX`M`L`LX`LX3`LX5`LX6@` index into the list of sizes
* `|$` convert to string and reverse the characters
The sizes with heights unique to them are:
* `XXXS` => `160 161`
* `XXS` => `165`
* `XS` => `167`
* `L` => `177 178 179`
* `XL` => `183`
* `3XL` => `190`
* `5XL` => `195 196`
* `6XL` => `199 200`
The only heights not covered by these sizes are `171 172 173`, which can be covered by either `S` or `M`. `M` is preferable, as it minimizes the differences between successive items of the list of heights. The other cutoffs between sizes were similarly chosen.
[Answer]
# [J](http://jsoftware.com/), 49 bytes
`M` is not needed, and the Xs are written out.
```
(+/\157,6 7#4 3)&(('X'#~0>._1+5|@-I.),'LS'{~5>I.)
```
[Try it online!](https://tio.run/##PY9dS8MwFIbv8yteNjCJ7bKk62dmiyAIQtVhbwLdWEQcKmPezKuV/fV6uk0hz/l4z3tC8tWPFN@gtOAIoWGJicLdS33fi2C6NEkWpsjGMWbySgju@PioK7U2QdLdTh6UDHnd8MMxqajuJWO70jrnGn@i8Y1/9LV3dE6cwyX@JVezfWnXEdolTKqJmIiI9Ew2aDnlGWGIQSNPTp6cZjn1@dAXRAZTkK8gXxFfatotMkRas9fttrQ7hAo3I4M9Y@9vH98Qzz97/@QX2i@MX0QyFJv5ao7WdkocFDoL2pMYHyEqHOy/IFp7PUWEyk7p6Z0KJV2qV3KksRq@Enyq2LD@Fw "J – Try It Online") Prints the table with all possible outputs. First column is the `f(n)`, followed by `n`, followed by the possible sizes for `n`.
* `157,6 7#4 3`: `157 4 4 4 4 4 4 3 3 3 3 3 3 3`
* `(+/\…)&f` `157 161 165 169 173 177 181 184 187 190 193 196 199 202` are the intervals `…,x_0], (x_0, x_1], (x_1, x_2], …`.
* `'LS'{~5>I.` get the interval index of `n` – if it is less than 5, then S, otherwise L.
* `('X'#~0>._1+5|@-I.),` interval index, subtracted by 5 (…, XS is -1, S is 0, L is 1, XL is 2, …), absolute value, take `max(n-1, n)` to lower the L side by one. Take this amount of X's and prepend it to the S/L.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~37~~ 36 bytes
Thanks to [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen) for -1 byte!
Looking at some answers in practical languages, this seems way too long.
```
‘—ŽS‘.sR…MLX`6×«ηí)˜IŽ6lbS3+.¥Ƶz+›Oè
```
[Try it online!](https://tio.run/##AUUAuv9vc2FiaWX//@KAmOKAlMW9U@KAmC5zUuKApk1MWGA2w5fCq863w60py5xJxb02bGJTMysuwqXGtXor4oC6T8Oo//8xNzU "05AB1E – Try It Online") or [See all outputs](https://tio.run/##AVUAqv9vc2FiaWX/NDFMIDE1OSt2eT8iIC0@ICI//@KAmOKAlMW9U@KAmC5zUuKApk1MWGA2w5fCq863w60py5x5xb02bGJTMysuwqXGtXor4oC6T8Oo/yz/)
This uses the following lookup table:
```
XXXS    160 - 162
XXS     163 - 166
XS      167 - 170
S       171 - 173
M       174 - 176
L       177 - 179
XL      180 - 183
XXL     184 - 186
3XL     187 - 190
4XL     191 - 193
5XL     194 - 196
6XL     197 - 200
```
`"SXXX"ηíR…MLX`6×«ηí)˜` generates all possible outputs, `IŽ6lbS3+.¥Ƶz+›Oè` selects the correct one.
```
‘—ŽS‘                  # dictionary string   "XXXS"
     .s                # take the suffixes   ["S", "SX", "SXX", "SXXX"]
       R               # reverse the list    ["XXXS", "XXS", "XS", "S"]
        …MLX           # push string literal "MLX"
            `          # push each character to the stack
             6×        # repeat "X" 6 times  "XXXXXX"
               «       # concat with "L"     "LXXXXXX"
                η      # take prefixes       ["L", "LX", ..., "LXXXXXX"]
                 í     # reverse each        ["L", "XL", ..., "XXXXXXL"]
                  )    # put the entire stack into a list
                   ˜   # and flatten the list
I                      # push the input
 Ž6l                   # compressed integer  1577
    b                  # convert to binary   "11000101001"
     S                 # split into digits   [1,1,0,0,0,1,0,1,0,0,1]
      3+               # add 3 to each digit [4,4,3,3,3,4,3,4,3,3,4]
        .¥             # un-delta, cumulative sum with 0 prepended
          Ƶz           # compressed integer  162
            +          # add to each element 
                       # [162,166,170,173,176,179,183,186,190,193,196,200]
             ›         # is each item larger than the input
              O        # sum the results
               è       # index into the list of possible outputs
```
---
A port of [agtoevers's Python answer](https://codegolf.stackexchange.com/a/214807/64121) comes in at ~~28~~ 25 bytes in the legacy edition:
```
Ƶи‹i'SƵвI-4ë'LIƵΔ-3}÷'X×ì
```
[See all outputs!](https://tio.run/##MzBNTDJM/W9i6KNgaGqpXVZpr6Sga6egZF/5/9jWCzseNezMVA8GsjZV6pocXq3uU3ls67kpusa1h7erRxyefnjNf53/AA "05AB1E (legacy) – Try It Online")
Thanks to [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen) for -3 bytes!
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~42~~ 26 bytes
```
≔⁻Ｎ¹⁷³θ×X÷±θ⁴×X⊖⊖÷θ³§LS›⁰θ
```
[Try it online!](https://tio.run/##bY47C8IwFIV3f0XodAMRWiqIOBUKEtAi6OBak0sNNFfzaPHfxzjZweVwhu881KP36tmPKTUhmIHgZGgKIOk1xW6yd/TABau2dVbH96uzNxThaiwGKG6FYJJia2ajEToc@ojgMrnh/B/bovJokSJqWPpfhxOs5nyRbqIkjW8ojpdccPCYJzyU3zMZSqnalWk9jx8 "Charcoal – Try It Online") Link is to verbose version of code. Port of @Port of @agtoever's answer, so outputs using `XXXL` etc.. Explanation:
```
≔⁻Ｎ¹⁷³θ
```
Subtract 173 from the input.
```
×X÷±θ⁴
```
If it's negative then print a number of `X`s equal to a quarter of the negated value.
```
×X⊖⊖÷θ³
```
If it's positive then print a number of `X`s two less than a third of the value.
```
§LS›⁰θ
```
Output `S` for negative and `L` for positive. The resulting lookup table:
```
XXXS    160 - 161
XXS     162 - 165
XS      166 - 179
S       170 - 173
L       174 - 182
XL      183 - 185
XXL     186 - 188
XXXL    189 - 191
XXXXL   192 - 194
XXXXXL  195 - 197
XXXXXXL 198 - 200
```
Previous 42-byte answer using `3XL` style output:
```
§⪪”{➙✳FＩ2κ？↓gＶＫ¤↘⸿⊙⁻QR”¶Σ÷Ｎ⁺¹⁶²Ｅ⁸Σ…426676ι
```
[Try it online!](https://tio.run/##LYzBCoMwEER/RXJaIYVq27TSU7EXwRYhlxy8WA0YiDGkibRfn67YYecxsMP0Y@f6udMxNk4ZDzdfmUF@gFutPBAhBG/NBjRejQl9WHFawURNaEJaQ1Ka8DBBZfxdLWqQmGzwzzC9pAN8Njq8IWM5TR6dhcvWLr@9luU4WyDHnLEzwzGV/nWNMSv2cbfoHw "Charcoal – Try It Online") Link is to verbose version of code. Explanation: Implements the following lookup table:
```
XXXS    160 - 161
XXS     162 - 165
XS      166 - 167
S       168 - 173
L       174 - 179
XL      180 - 186
3XL     187 - 192
5XL     193 - 196
6XL     197 - 200
```
`XXXS` is used for sizes of up to 161, and subsequent sizes depends on how many digits from the substring `426676` can added while the keeping the total less than the input, with `0` digits giving `XXS` and `7` digits (by repeating the initial `4`) giving `6XL`. (It's not possible to repeat additional digits as the 6th digit must be at least 6 but neither of the first two digits can be that high.)
[Answer]
# [Python 3](https://docs.python.org/3/ "Python 3"), ~~278~~ ~~277~~ ~~260~~ 217 bytes
-1 byte thanks to @HyperNeutrino
  
-17 bytes thanks to @SunnyMoon
  
another -43 bytes thanks to @HyperNeutrino
```
lambda x:[c for a,b,c in[[160,165,"3XS"],[162,167,"XXS"],[166,171,"XS"],[168,174,"S"],[174,183,"L"],[180,187,"XL"],[184,190,"XXL"],[187,194,"3XL"],[191,195,"4XL"],[193,199,"5XL"],[197,201,"6XL"]]if x in range(a,b)][0]
```
[Try it online!](https://tio.run/##Nc@9DoIwFAXgWZ@i6QTJHVr@2pL4Bm4uJNgBULSJAiEM@PR4ys/Wr03PPXf4Te@@i5f2cl8@1bd@VGzOy4a1/cgqqqlhritLmQmSWUo8Lm7cEhzBinhxOCOpJLxTgwnxTThJHRO/rtKI0v7rTjwa4ZN2KzjxkzYbCWNycjiGDfH0sKJIYHLmbV3LZjRmY9W9ngEWCG0p7OK3cf5@b56iHmooZCm9lpPa0Jbt@2hkCpufT8PouiloAxeGyx8 "Python 3 – Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/), 39 bytes
```
$_=$_<174?X x(57-$_/3).S:X x($_/3-60).L
```
[Try it online!](https://tio.run/##Fcq9DoJAFEThnqewoJAC3OVn516j8QXsbOyoLEyIELTw6V0PxUlmkm95rNOQczmey/EU1V/uu@9@UF2Oh65qbsftbrtOoWquOccUipgitdRRTwMlEhl5EYUTTjjhhBNOOOGEE85whjOc4QxnOMMZznCGc5zjHOc4xznOcY5znHvRhvCbl89zfr1zvUx/ "Perl 5 – Try It Online")
With all tests: [Try it online!](https://tio.run/##bdJdb4IwFAbge37FyVInJMioIh8y3C53oVfugsQYsmlRtvERionG4F9npzjUBbgq7dPznqbNWP4zruIjCb2K7z9PJPCyNHNJ8Ewt48WHgzy2BiR4GinaYiJ@xXhg6oo2KytX2nMG74wXk8k8zZkrxUfosUPmQrbnu9cTwfGJkGCpr8pSBTGiKwjTXAL85PgjW2LgtO/7/qK/UsUkNXVNo6ahqC3TEDRDYcy2uRI0JhpLb5kbQWMLM2qZ@Z2xqDDtrNm9MdDYw3Y/N0RtcS67o@cbonZdx@kwV0RtC40z6jINoo7o2TE6zR/CEsLY3eaCqINZQ11XXAnvDPBySZRkINd3JOZP9V4xv00L8OCRhLIguKFZwBeAC19plEAfsEhfheZdICzLm@RFjpJneZQUITy8sWi7Ky6J6xi8KfQGDgfcydYF20ygxx/UOlitUy6F0m@57uV8/h@j1vWxr1LapAkLCny0UbJ1q18 "Perl 5 – Try It Online")
Recognising that size M is not needed and that the number of X'es can be calculated from a difference divided by 3. Uses unquoted barewords for S, L and X.
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~26~~ ~~25~~ 25 bytes
*Edit: fixed bug, same bytes*
```
§:oR'X?_-3<0o?'S'L<1-57/3
```
[Try it online!](https://tio.run/##yygtzv6f@6ip8VHDMkMzAwUjA4P/h5Zb5QepR9jH6xrbGOTbqwer@9gY6pqa6xv//w8A "Husk – Try It Online")
```
§:oR'X?_-3<0o?'S'L<1-57/3
                    -57/3  # x = (height/3)-57
§:                         # now join 2 strings: 
            o?'S'L<1       # string 1: 'S' if x<1, 'L' otherwise
  ȯR'X                     # string 2: repeat 'X' 
      ?_-3<0               # if x is positive: x-3 times
                           # if x is negative: -x times
```
[Answer]
# [Groovy](http://groovy-lang.org/), ~~74 71 70~~ 64 bytes
```
f={('XXXSXXSXSSMLXLXXL3XL4XL5XL6XL'=~/\d?X*./)[it/3.4-47as int]}
```
[Try it online!](https://tio.run/##VdJBb4IwFAfwO5/i3aSLVhSGuEyXbJcd6ollaeI8NO6p3RAMrS7OsK/uWlAEwsX8eP/3@uo6z7LD8XxeTU5uh3Me2zeOZ4wzzpnPWcDZPWchZ53JX//j84nf0T6ZS933adALRkKBTPWiOMvtLss1fImDoHstE6p0jmJLX7IkwaXOcuU4M7GDg0j2qGACcwcuT9m38wDuIPQoHYQB6TYt7kBpQ2thywxVFhobeU2zVFlkzW/a7GqjgbVWJqstMBYNW/3YpV9k54zas1gsrawbN82vbWRs3JoluNrYzjJunf2@Nt9a1LSwNpM59DziLJxqwzI9YK7w/broauMUU50fY9QuuVyNS@o0ukqEtrUnQOhNAWlZVH9It6WZa@8a@8bjAgoobuXL6pLd22XTdZ7tdzJdPx/dE0g990xJF04p/sBbjmiaPU5dUtxOdH0aGaarjagCBmVAQ3V2@SGz1Axnk5lMv/HzVaiNOajNh4IQ4jitlVAUy40p2KBcb8yBlPw1e@pNy0mEUmj@xiu3UmK2WX3gFOd/ "Groovy – Try It Online")
1. `('XXXSXXSXSSMLXLXXL3XL4XL5XL6XL'=~/\d?X*./)` finds all matches of the regex against the string, i.e. `[XXXS, XXS, XS, S, M, L, XL, XXL, 3XL, 4XL, 5XL, 6XL]`.
2. `it/3.4-47as int` converts the height to a valid index within the list of matches.
3. `(string=~pattern)[index]` retrieves the match at the given index
[Answer]
# [Python 3](https://docs.python.org/3/), 85 bytes
```
lambda s:[b for*b,a in b"3XSB XXSD XSH SK LT XLX 3XL_ 5XLd 6XLf".split()if s-99<a][0]
```
[Try it online!](https://tio.run/##FctBC4IwFADgv/Lw9BYmmiQonaJD0G7r8EAktrbVwKa4HfTXr/ru37zF9@TrZKcFVnAeFulfBqumzA9lxbp5cT7imqstmoCYRvlRWkLoegW/s1O5/C@V1STOQCQuQOIK4gb8DsQJauIPOBLX0BC3WRHm0UVkzkLYt@1JDn05JIYrY4U2z0kbZCx9AQ "Python 3 – Try It Online")
Outputs as a list of ASCII code-points.
[Answer]
# [Julia](http://julialang.org/), 65 bytes
```
x->split("XXXS XXS XS M L XL XXL 3XL 5XL 6XL")[x.<162:4.3:204][1]
```
[Try it online!](https://tio.run/##RdDNaoQwEADge55iyMmAXYxxYwy720uP7mkvAfFQ1hVSxC7qFh@k9NSn64vYSdIqOBI/Mz/M26Ozr3xeWjjCMj@dxntnp4gaYy7g4wJnKMHggyEw9hjSlJRV8@7AZaqzndBpktUVr5cGy7zY6xQRAF@EwvEEXCaayywOiBYwRZQBnQWUmueJR28BFaLweF4x54ghvdww01yloWb5X1Nhd/XXyKtHd7PwKDbMNS9Co2zFAhsVYfj9hgJReZQb5rgIHJ4R8nEbbBvZGEaGK7Fge2iqsSakfR/Cp1sK3iZu9Ptg@6nrozULX4zBM9Cf70@goN3hC2iMqdjI/yW3viHLLw "Julia 1.0 – Try It Online")
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 57 bytes
```
.+
$*1-174$*
(1+)-\1
-
-(1111)*1+
$#1$*XS
111
X
X?X?1*-
L
```
[Try it online!](https://tio.run/##K0otycxL/M9lZGCgosXlq6iWoFdtaGagA@TXcvkncKlq@CYY/tfT5lLRMtQ1NDcBKtIw1NbUjTHk0uXS1TAEAk0tQ6C0sqGKVkQwF5DPFcEVYR9hb6ily@Xz/z8A "Retina 0.8.2 – Try It Online") Link includes test suite. Port of @agtoever's answer, so outputs using `XXXL` etc.. Explanation:
```
.+
$*1-174$*
(1+)-\1
-
```
Convert to unary and subtract 174.
```
-(1111)*1+
$#1$*XS
```
If the result is negative, then negate, subtract 1, and divide by 4, which gives the size in `X*S`.
```
111
X
X?X?1*-
L
```
Otherwise, divide by 3 and subtract up to 2, which gives the size in `X*L`.
The resulting lookup table:
```
XXXS    160 - 161
XXS     162 - 165
XS      166 - 179
S       170 - 173
L       174 - 182
XL      183 - 185
XXL     186 - 188
XXXL    189 - 191
XXXXL   192 - 194
XXXXXL  195 - 197
XXXXXXL 198 - 200
```
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 128 bytes
```
L=kfd90HK
H=uBgI0LP
s=$[$1-150]
c=L
((s<24))&&c=S
for ((;;i++)) {
(($[64#${L:i:1}]<s&&s<$[64#${H:i:1}]))&&echo $c&&exit
c=X$c
}
```
[Try it online!](https://tio.run/##S0oszvj/38c2Oy3F0sDDm8vDttQp3dPAJ4Cr2FYlWsVQ19DUIJYr2daHS0Oj2MbIRFNTTS3ZNpgrLb9IQUPD2jpTW1tTU6EaKKsSbWairFLtY5VpZVgba1OsplZsAxXzgIiB9KYmZ@QrqCQDGRWZJUBzI1SSuWq5/v//b2hhDgA "Bash – Try It Online")
Ungolfed version below for review:
```
# Size  cm range	-150	>Low	<High	# of X
#XXXS	160-163		10-13	9		3
#XXS	164-165		14-15	13	16	2
#XS	166-170		16-20	15		1
#S	171-173		21-23	20		0
#M
#L	174-179		24-29		30	0
#XL	180-186		30-36		37	1
#XXL
#3XL	187-193		37-43		44	3
#4XL
#5XL	194-196		44-46	43	47	5
#6XL	197-200		47-50	46	51	6
#L=20 15 13 9 0 43 46
#H=30 37 16 44 0 47 51
L=kfd90HK
H=uBgI0LP
# print the high and low threshold arrays to verify base64 numbers
for ((k=0;k<7;k++)) {
  l=$[64#${L:k:1}]
  h=$[64#${H:k:1}]
  echo $k: low:$l high:$h	
}
echo
# Test set: check algorithm on all values [160-200]
for ((j=160;j<=200;j++)) {
  s=$[j-150]
  c=L;((s<24))&&c=S
  for ((i=0;i<8;i++)) {
    l=$[64#${L:i:1}]
    h=$[64#${H:i:1}]
    ((l<s&&s<h))&&echo $j:$c&&break
    c=X$c
  }
}
```
[Try it online!](https://tio.run/##VZJBb6MwEIXP9q8YCYSIKiQbjB0I9LCnrJaVVsoekKocCHECgYQVJq26VX57dpx2U/U09vvs5zcjbyrTXK8OrNq/GqA@wlid9poEPGbksRheSLZs9w1xYNhBSZ2yLFeESxZwGRHCsUYkISSyxAKBIEaANSbIuCQhMotkwBVDJIOQEW4PUQd1xVFHr5AHYUQQEUadn9QpEKGLQvdQBKF9hFlUIpjju3NplSCyRVmvsiyoE92wCngSWT0QWISw@YTFscUJ2ibS6oGQBE8IRWLqyBtTmA4zCBXgABDHnEiKafKQAY@BR5AAAxGBkNRZ5hGDSAGXIISVFcScFnm32yZs@YMu8/O3/XdW/EIH@DO2pwmmRkODE4XqtIV@eEFh1KYZ@i1U41i9GpgGeNZju3uFTWW0FHA6Hzd6NHQ3jOD7Xc4WXaYW3cPDbAZvFKDP3ScpHPetSLuUX9YoNf@l5V3SdTOA26X20dTtbyFStyH0Qi2yCX9rM4HRUwp1o@sOqn4/jO3UHGE44aaH56o/awNP9gPgmNYfkQ45CotDhjPCcs9lMMTBfqQ1xV2dFwvfN1koZjPPq/MVau/XW@yozeaL9n7zS0/tRwNfuvoUfb/PjOeZrLG@710eUrf2vM2oq@52ps5Lt8bVBZu9Xv8B "Bash – Try It Online")
]