[Question]
      [
This challenge is similar [to my previous one](https://codegolf.stackexchange.com/questions/144053/distances-to-coordinates), but has a twist that makes it significantly more difficult.
There are *n* people on a 2D plane. Using distances between them we're going to find their positions. You may make four assumptions:
1. There are at least 3 people.
2. The first person is at position (0, 0).
3. The second person is at position (x, 0) for some x > 0.
4. The third person is at position (x, y) for some y > 0.
However, **all distances are floored to integers**! For example, if the actual distance between two people is 4.7 units, your program will see the distance 4 as input instead.
So your challenge is to write a program or function that given a 2D array of **floored** distances (where `D[i][j]` gives the distance between person `i` and `j`) returns a list of their coordinates.
The challenge here is that you have incomplete information, and must try to extract as much precision as possible. Therefore this challenge is not a code golf, instead it's a code challenge, and the winner is the answer that returns the most accurate results.
---
# Scoring
I will provide a series of arrays of coordinates. It is up to you to turn these arrays into 2D distance matrices **and flooring each element in these matrices** (if I were to do that here this question would get way too large).
For a certain input use your answer to predict the coordinates of each person. Then, for each person calculate the squared distance between the prediction and actual position. Sum all these and divide by the number of people in the input. That is your score for this input.
The total score of your answer is the average score you get for all of the following inputs:
```
[(0, 0), (0.046884, 0), (-4.063964, 0.922728), (-3.44831, -6.726776), (-0.284375, -0.971985)]
[(0, 0), (0.357352, 0), (-1.109721, 1.796241), (-7.894467, -3.086608), (-3.74066, -1.528463)]
[(0, 0), (6.817717, 0), (-6.465707, 0.705209), (-2.120166, 3.220972), (-2.510131, 8.401557)]
[(0, 0), (0.394603, 0), (-4.097489, 0.957254), (-5.992811, 1.485941), (-2.724543, -3.925886)]
[(0, 0), (6.686748, 0), (6.088099, 0.22948), (8.211626, -4.577765), (-1.98268, -4.764555)]
[(0, 0), (2.054625, 0), (0.75308, 0.497376), (6.987932, -5.184446), (0.727676, -5.065224)]
[(0, 0), (6.283741, 0), (-1.70798, 5.929428), (2.520053, 6.841456), (-2.694771, -1.816297)]
[(0, 0), (1.458847, 0), (5.565238, 7.756939), (-4.500271, 4.443), (-0.906575, 3.654772)]
[(0, 0), (0.638051, 0), (-2.37332, 0.436265), (-8.169133, -0.758258), (-7.202891, -2.804207)]
[(0, 0), (1.101044, 0), (-1.575317, 6.717197), (-2.411958, -7.856072), (-4.395595, 2.884473)]
[(0, 0), (7.87312, 0), (-0.320791, 2.746919), (-1.4003, 0.709397), (-0.530837, -0.220055), (-3.492505, -7.278485), (2.401834, 2.493873), (0.911075, -5.916763), (4.086665, -5.915226), (2.801287, 5.409761)]
[(0, 0), (0.304707, 0), (-1.709252, 0.767977), (-0.00985, -0.356194), (-2.119593, 3.353015), (1.283703, 9.272182), (6.239, -0.455217), (7.462604, 1.819545), (0.080977, -0.026535), (-0.282707, 6.55089)]
[(0, 0), (3.767785, 0), (0.133478, 0.19855), (-0.185253, -5.208567), (-6.03274, 6.938198), (5.142727, -1.586088), (0.384785, 0.532957), (3.479238, -1.472018), (3.569602, 8.153945), (-0.172081, 2.282675)]
[(0, 0), (0.445479, 0), (-3.3118, 8.585734), (0.071695, -0.079365), (2.418543, 6.537769), (1.953448, 0.511852), (-1.662483, -5.669063), (0.01342, 0.097704), (0.919935, 1.697316), (2.740839, -0.041325)]
[(0, 0), (3.281082, 0), (-6.796642, 5.883912), (-3.579981, -2.851333), (-1.478553, 6.720389), (3.434607, -9.042404), (7.107112, 2.763575), (-4.571583, 1.100622), (-1.629668, 1.235487), (-3.199134, 0.813572)]
[(0, 0), (5.278497, 0), (-4.995894, 3.517335), (-0.012135, 3.444023), (0.364605, -0.49414), (1.73539, 1.265443), (-7.289383, -3.305504), (-7.921606, 5.089785), (-1.002743, -0.554163), (-8.99757, -3.572637)]
[(0, 0), (2.331494, 0), (1.83036, 2.947165), (-5.520626, 1.519332), (5.021139, -4.880601), (-0.318216, -0.063634), (-5.204892, -5.395327), (-0.92475, -0.090911), (-0.19149, -2.188813), (-0.035878, 0.614552)]
[(0, 0), (2.981835, 0), (-3.909667, 2.656816), (-0.261224, -2.507234), (-7.35511, -3.65201), (1.198829, 5.328221), (-5.139482, -4.320811), (-3.253523, 2.367497), (6.254513, 1.565134), (3.13451, 4.595651)]
[(0, 0), (1.059838, 0), (-0.849461, 7.87286), (2.108681, 0.717389), (-0.065587, -0.007163), (2.818824, 5.529878), (2.413443, 4.102863), (-3.050506, -2.541446), (-1.215169, -4.818011), (-1.671743, 2.539397)]
[(0, 0), (5.036602, 0), (-1.627921, 1.813918), (-9.285855, 1.277063), (2.271804, -0.51118), (-7.070704, 2.252381), (6.125956, -4.278879), (1.000949, -1.38177), (-0.67657, -2.747887), (2.820677, -5.718695)]
[(0, 0), (0.733516, 0), (6.619559, 1.368964), (-0.047351, 0.545139), (-4.518243, -7.506885), (3.31011, -4.329671), (3.885474, -1.535834), (-3.952488, -1.94899), (1.402441, 7.538954), (2.385809, 4.042365), (-6.403547, 3.623895), (3.742502, 0.025475), (1.944868, -2.972475), (-0.514566, -1.015531), (-0.08634, 5.140751)]
[(0, 0), (2.374024, 0), (-1.016305, 1.31073), (2.176473, -1.357629), (0.181825, 2.107476), (-0.978214, -3.436398), (0.828254, -0.39516), (2.981311, -6.761157), (1.517599, 5.009197), (8.063442, 0.930487), (4.628231, 7.749696), (3.810604, 4.671208), (1.158015, 2.914197), (-9.230353, -0.473591), (-9.031469, -4.206725)]
[(0, 0), (5.733822, 0), (1.394054, 1.432354), (1.556614, 5.691443), (3.665168, 7.199478), (-0.670337, 0.396217), (4.144468, 2.959243), (-6.129783, -7.048069), (-3.230162, 3.116924), (-6.365913, 3.727042), (-0.174385, 0.253418), (-0.454495, -4.415929), (5.815488, 1.443031), (-4.288448, 0.619174), (1.957015, 0.784202)]
[(0, 0), (6.550779, 0), (-8.592692, 1.728506), (-6.460692, 2.344509), (8.359129, 4.578714), (3.593451, -4.172634), (8.697976, -2.379752), (4.27242, 5.296418), (2.920394, -4.520174), (0.662004, 2.171769), (1.879771, -1.873537), (0.769374, 3.570321), (-3.438699, -3.255416), (3.23342, -3.220256), (-0.002136, -5.646753)]
[(0, 0), (5.013665, 0), (-0.543516, 9.981648), (8.378266, 5.33164), (4.759961, -2.007708), (2.88554, 1.069445), (-6.110542, -6.253516), (0.292062, -0.052982), (-4.869896, -1.251445), (1.61841, 7.980471), (-0.313257, 0.515709), (8.673848, -2.269644), (-0.446207, -0.568228), (3.015721, -2.819861), (1.160386, -5.897356)]
[(0, 0), (0.437257, 0), (-3.127834, 8.941175), (0.785858, 1.99155), (2.005894, -6.723433), (1.332636, -6.214795), (3.149412, 7.17296), (-5.350834, -5.106189), (1.447561, 0.910621), (3.032259, -7.977927), (1.520669, 5.121877), (-1.075969, 0.098313), (1.015673, -5.244922), (3.575391, 5.270148), (-9.160492, 2.943283)]
[(0, 0), (3.63663, 0), (5.448045, 8.287277), (1.314494, -0.164441), (-1.941398, 4.223086), (5.025181, 0.495811), (-8.466786, -2.933392), (-0.139755, 0.730451), (-0.098497, -0.587856), (-3.337111, -1.238969), (2.142947, 2.521078), (0.352537, 5.4194), (-4.49191, 5.261929), (2.198984, -3.781113), (3.525393, 1.150581)]
[(0, 0), (4.540155, 0), (-7.248917, 2.368607), (2.434071, 1.763899), (3.990914, 1.135211), (-5.422214, -5.785259), (0.526037, -0.888364), (-0.370255, 8.515669), (0.77125, 4.48859), (3.9838, -2.3101), (-2.993973, -0.775446), (-1.731491, -1.028441), (-0.184254, 0.281876), (0.048732, 0.222435), (0.108646, -0.344878)]
[(0, 0), (4.934251, 0), (7.472259, 4.693888), (0.057108, -0.038881), (-0.276457, -0.157808), (-6.745232, -0.357168), (5.979037, -0.653591), (-3.969328, -6.050715), (4.19821, -1.883165), (-4.294607, -0.407446), (-6.11544, 0.480539), (1.193587, -1.028919), (-0.387421, 2.036394), (5.78394, 1.333821), (4.178077, 4.286095)]
[(0, 0), (7.547164, 0), (0.989783, 1.074185), (0.192979, 0.210046), (6.528904, 0.400088), (5.602168, 5.791553), (4.058506, 3.995028), (-1.033977, -5.44405), (5.767663, -6.702417), (4.401684, -3.097193), (-0.821263, 4.624133), (6.031465, 6.544092), (7.188866, 1.599597), (5.327328, 3.51571), (1.305662, 7.488827)]
[(0, 0), (0.638053, 0), (7.279348, 5.416438), (-6.495944, -1.385692), (5.348119, 6.89312), (-5.145817, -5.640294), (2.909321, -3.139983), (7.052144, 3.902919), (2.467506, 1.362787), (3.469895, -7.977336), (7.598683, -5.947955), (-0.679492, 9.140908), (-3.310304, 3.134427), (-0.83399, 5.797306), (4.08935, 0.830119), (-7.764758, -4.403114), (5.183087, -8.528744), (-0.75072, 6.163092), (-0.692329, -0.225665), (2.0628, -2.008365)]
[(0, 0), (9.468635, 0), (2.005581, 2.669352), (3.416536, 6.9941), (-3.293394, 0.864229), (-1.044833, 2.243219), (6.011018, 4.014313), (-0.959567, 9.620265), (-1.855409, 1.890371), (-0.629015, -1.383614), (4.087875, -2.203917), (3.286183, -7.748879), (-7.781181, -5.295325), (3.28653, -0.930535), (3.973893, -1.784441), (-7.7541, 4.355823), (1.522453, -1.960952), (5.085025, -1.511887), (8.401342, -2.139507), (-1.727888, 0.7952)]
[(0, 0), (8.617779, 0), (-7.012573, 5.883927), (-3.508725, -6.838323), (6.676063, 6.884947), (8.297052, -0.134775), (7.416737, 5.915766), (-5.10108, -7.183776), (-4.651823, 5.434926), (-1.099239, -0.238062), (-0.313045, 0.354853), (-7.592061, 5.408053), (0.566482, 0.652099), (-3.551817, -3.365006), (8.514655, 4.653756), (-4.249357, -2.130864), (1.181348, -1.22839), (2.469081, 1.110794), (1.831897, -1.552467), (-5.892299, -1.919411)]
[(0, 0), (2.407206, 0), (-6.771008, 0.810524), (-3.840048, -0.152269), (7.109171, -5.609477), (-7.391481, 5.639112), (-8.670299, 2.742321), (0.586435, 4.542551), (-0.442438, 0.107817), (4.31145, -1.409808), (-4.534678, -1.504437), (4.680038, -3.080315), (-4.973063, 5.638478), (6.127056, -7.491446), (2.291953, -2.357609), (3.510856, -9.171005), (3.971143, -8.515823), (0.049413, -5.842664), (1.058161, -0.21883), (7.093364, -3.604422)]
[(0, 0), (6.969461, 0), (4.338403, 5.197497), (0.369553, -0.770371), (8.882643, 1.450294), (2.124852, -1.210185), (-3.046623, -4.395661), (7.716904, 4.60951), (-0.83271, -0.854575), (-2.333383, -0.308884), (-6.347966, 3.124373), (0.832848, -1.892136), (1.446553, 1.613845), (-2.241092, -6.53878), (5.004282, 5.401177), (3.31202, 0.432188), (0.164548, 1.23087), (9.860844, -0.125136), (0.133559, -0.202543), (2.686551, 1.013555)]
[(0, 0), (9.107655, 0), (5.455882, 3.54979), (-0.681513, 2.950275), (7.369848, 4.050426), (5.320211, -8.288623), (-5.315311, 4.632769), (-2.801207, -3.00623), (2.502035, -2.085464), (-0.645319, -4.854856), (3.639806, -8.669185), (-0.732853, 2.379454), (-8.722855, 2.483643), (-0.03048, 1.845021), (-6.904949, -2.596416), (0.685437, 1.042775), (-5.182001, -2.617796), (1.595501, 0.885512), (-8.567463, -0.607195), (-5.456613, 5.81163)]
[(0, 0), (1.669656, 0), (-3.385149, 6.655961), (-1.501983, -0.746686), (1.962876, -0.780073), (0.51437, -4.130592), (1.825567, 0.531272), (-4.188001, 0.514048), (-5.894689, 1.726502), (-1.429067, -3.558197), (4.605078, 2.060605), (1.670708, -8.99749), (5.44004, -5.315796), (-0.619392, 1.785159), (-2.854087, 1.696694), (4.974886, 6.291052), (-0.699939, -5.930564), (-2.35508, -0.057436), (-0.804635, -0.687497), (2.289458, 1.946817)]
[(0, 0), (3.626795, 0), (5.048495, 1.581758), (0.154465, 3.132534), (-4.862419, 7.051311), (3.927243, -0.408956), (-7.41798, -0.313768), (1.987639, -7.957834), (-1.100923, -1.442563), (1.949075, -0.382901), (5.696638, 3.400352), (-1.121574, 1.315934), (-4.37434, 4.937007), (-1.244524, -7.36647), (9.138938, 4.035956), (-0.207342, -4.257523), (-1.298235, 5.950812), (2.17008, 1.116468), (-1.410162, 4.861598), (4.69532, 2.076335)]
[(0, 0), (9.787264, 0), (-4.65872, 0.957699), (-2.813155, -1.174551), (-0.445703, 0.362518), (2.920405, 0.914672), (-1.63431, 0.048213), (-0.534393, -2.389697), (-0.105639, -1.589822), (-0.100723, 8.648806), (-6.894891, 4.8257), (7.417014, 2.868825), (-0.84031, -0.322606), (-0.802219, 1.209803), (7.808668, 1.700949), (-3.270161, -3.463587), (-1.118415, 0.713057), (4.130249, 0.824635), (4.664258, 5.993324), (2.575522, -1.031243)]
[(0, 0), (6.514721, 0), (-2.2931, 3.6007), (3.388059, 1.102576), (-1.777694, -2.809783), (3.431761, 6.534511), (-8.13158, -2.940151), (-4.856169, 2.834183), (-0.706068, -0.93294), (-0.393184, -4.989653), (4.480243, -4.107001), (1.681165, 0.611419), (4.442544, -0.536704), (4.90654, -7.356498), (-8.722645, 1.203365), (-2.067292, -4.134382), (-3.002458, 7.891842), (1.398419, -1.279873), (0.237866, 0.010691), (6.879955, -2.882286)]
[(0, 0), (1.421587, 0), (-0.615169, 0.286873), (0.848122, -2.730297), (0.220832, 0.89274), (4.588547, 8.497067), (-5.079677, -8.428552), (-3.170092, 2.418608), (1.309388, -3.658275), (1.639533, -2.364448), (-1.327656, 1.006565), (-0.475542, 0.298309), (5.430131, -8.343581), (8.430933, 4.118178), (-2.090712, -0.470172), (1.146227, -6.664852), (-0.542811, 1.909997), (0.439509, 6.112737), (0.343281, 0.630898), (-3.673348, 5.101854), (-0.072445, 5.784645), (4.895027, -7.960275), (-9.633185, -1.688371), (8.059592, -5.178718), (-2.334299, 1.217686)]
[(0, 0), (5.456611, 0), (0.181969, 2.084064), (0.89351, -2.507042), (1.570701, 1.202458), (0.814632, 1.883803), (2.790854, 5.8582), (0.699228, 2.377369), (-0.463356, 5.162464), (1.166769, 4.739348), (-4.652182, 5.553297), (-1.123396, 4.186443), (-0.327375, 0.45977), (-0.395646, -4.122381), (0.652084, -0.696313), (0.716396, 2.005553), (0.73846, -7.361414), (-1.912492, 3.937217), (-0.162445, -2.681668), (-0.133005, -0.910646), (2.194447, -4.169833), (-3.132339, -3.079166), (-3.078943, -1.410719), (-1.365236, -4.103878), (2.044671, -0.831881)]
[(0, 0), (1.382529, 0), (5.031547, 7.747151), (-0.49526, 0.019819), (-7.918566, -1.919355), (1.046601, -4.397131), (3.113731, 8.325339), (-1.700401, 1.511139), (-2.699135, -5.052298), (3.434862, -2.609676), (-4.506703, -0.424842), (0.154899, 3.782215), (1.373067, 4.412563), (4.548762, 2.096691), (-0.0275, -2.604761), (4.462809, 1.533662), (-2.016089, -3.481723), (7.024583, 6.980284), (0.254207, -7.964855), (-2.055224, -1.374547), (-3.185323, -3.753214), (-0.479636, -7.476727), (2.208698, -6.374003), (0.24381, -0.620774), (-0.551312, -3.796487)]
[(0, 0), (3.442359, 0), (-5.045461, 1.685484), (0.072923, 1.158112), (-1.347292, 2.626515), (1.982477, 4.374474), (-3.188879, -4.020849), (-0.430788, 0.118491), (0.725544, 1.992762), (-2.893352, -4.311321), (-6.871016, -2.359638), (1.406456, 1.734539), (2.029903, 6.151807), (7.565244, 1.948656), (-6.420158, 0.698035), (-4.873019, 3.593625), (9.548917, -0.45405), (-8.701737, -1.872887), (-7.941202, -1.4121), (-5.995713, 0.555241), (-5.704163, -2.868896), (-2.677936, -1.924243), (-3.460593, -8.679839), (0.631064, -0.433745), (1.18902, -1.496815)]
[(0, 0), (6.537782, 0), (-6.75348, 0.404049), (-5.348818, 5.082766), (-3.738518, -7.824984), (4.513721, -7.740162), (-7.707575, 3.393118), (-0.11626, 0.439479), (0.12586, -2.885467), (4.952966, 5.673672), (2.56597, -0.333544), (-4.60141, 2.716012), (-1.865207, 1.826155), (3.234169, -0.966176), (-5.977172, 1.660029), (-7.968728, 0.889721), (-0.028198, 0.153274), (-5.427989, 8.150441), (-3.708225, -0.777001), (3.513778, 0.529579), (6.309027, 0.399666), (0.542878, 1.900558), (-0.633748, -4.971474), (5.340487, -2.474143), (-0.805431, -8.633636)]
[(0, 0), (0.211756, 0), (3.03609, 1.381372), (1.472087, 3.505701), (-0.198393, -0.284868), (4.290257, -7.630449), (-0.120326, -0.047739), (3.167345, -1.144179), (7.791272, 6.043579), (6.125765, -6.3722), (-0.178091, 9.313027), (-4.177894, -0.704969), (-2.950708, 1.716094), (-0.016133, -0.105582), (-5.962467, 6.088385), (0.901462, 0.58075), (2.063274, -0.221478), (-0.430464, 0.9548), (4.824813, -4.037669), (0.863528, 8.321907), (2.693996, -0.380075), (0.879924, 4.243756), (-7.759599, -2.81635), (2.58409, -2.225758), (5.515442, -7.445861)]
[(0, 0), (0.958126, 0), (-0.566246, 3.074569), (2.666409, -4.784584), (-5.490386, 1.820646), (0.505378, 0.261745), (-0.122648, -9.791207), (0.569961, 1.044212), (-8.917451, -1.667965), (-7.374214, -1.193314), (-4.559765, -2.486695), (2.367622, 1.707526), (0.762113, -5.553413), (-9.62438, -2.077561), (-0.072526, -0.072188), (-2.051266, -5.410767), (-6.656983, -1.824092), (1.170361, 2.019313), (2.689391, -3.998207), (1.814094, 1.782214), (0.498034, -9.437937), (0.87507, 0.670687), (-8.114628, 4.823256), (2.693849, 6.952855), (-0.005543, -0.01139)]
[(0, 0), (1.703854, 0), (1.091391, 2.171906), (5.559313, -0.310439), (-0.396107, -0.771272), (-5.136147, 7.769235), (8.969736, 0.885092), (3.541436, -6.530927), (-0.461503, -5.877802), (-6.108795, -5.163834), (3.698654, 3.749293), (8.049228, 2.056624), (-6.022241, -0.657227), (-8.701763, 4.803845), (1.225822, -2.070325), (2.099514, 5.191076), (0.500653, -0.104261), (-0.581698, -5.755634), (-5.150133, -8.269633), (2.559925, 6.839805), (-0.149545, 4.456742), (1.43855, 1.865402), (3.439778, -4.954683), (-4.18711, 7.244959), (0.640683, 0.907557)]
[(0, 0), (6.577004, 0), (0.042196, 0.025522), (8.61361, -0.689878), (5.407545, 1.709241), (-4.724503, 3.123675), (4.329227, -5.283993), (-1.238506, -1.104368), (-0.758244, 1.882281), (3.851691, -0.571509), (-0.229269, 7.452942), (2.833834, -6.742377), (-8.49992, 1.912219), (3.102788, -9.456966), (-0.420271, 2.449342), (4.123196, -0.512152), (5.893872, -3.689055), (-3.801056, -3.486555), (-3.576364, 3.448325), (-0.397213, -0.010559), (-4.519186, 4.525627), (2.720825, 6.0414), (0.918962, -0.430301), (2.217531, -3.056907), (0.912148, -1.487924)]
[(0, 0), (0.170063, 0), (1.088807, 2.795493), (5.884358, -1.914274), (9.333625, -0.111168), (7.168328, 4.042127), (2.558513, -0.146732), (-8.011882, -2.358709), (-0.374469, -6.591334), (2.495474, 1.011467), (0.094949, -0.351228), (7.0753, 1.26426), (6.614842, 4.664073), (-2.777323, 7.287667), (3.280189, -6.811248), (-7.254853, -1.472779), (7.147915, 1.932636), (-3.431701, 3.030416), (-0.863222, -1.177363), (0.512901, -0.258635), (-5.614965, 0.462802), (3.452843, -6.869839), (7.475845, -0.353582), (0.067355, 0.298013), (4.39831, -8.5387)]
```
**It's not allowed to optimize specifically for this set of inputs. I may change these inputs to any others at my discretion.**
Lowest score wins.

[Answer]
# [R](https://www.r-project.org/), score = 4.708859
```
require(vegan)
solve_mmds<-function(dpf,noise=0,wgs=rep(1,nrow(dpf))){
  #MMDS
  v = wcmdscale(dpf+noise,2,add=TRUE,w=wgs)

  #center on first point
  v = sweep(v,2,v[1,])

  #rotate to adjust second point
  alpha = atan2(v[,2],v[,1])
  alpha_rot = alpha - alpha[2]
  radius = sqrt(apply(v^2,1,sum))
  v = cbind(cos(alpha_rot), sin(alpha_rot))*radius

  #flip to adjust third point
  if(v[3,2]<0){
    v[,2]=-v[,2]
  }

  #return
  v
}
N_input = length(input_data)
err_runs = rep(0,N_input)
for(i_input in c(1:N_input)){

  p = matrix(input_data[[i_input]],ncol=2,byrow=TRUE)
  n = nrow(p)

  dp = as.matrix(dist(p,upper=TRUE,diag=TRUE))
  dpf = floor(dp)

  v = solve_mmds(dpf)
  err_runs[i_input] = mean(apply( (p-v)^2, 1, sum))
  cat("test #", i_input," MSE:", err_runs[i_input],"\n")
}
cat("Average error: ", mean(err_runs)," \n")
```
[Try it online](https://tio.run/##dVvLbl3ZcZ3rK4j2hEyoi/1@GNYgQDx0BnmMOu0GLVJtBmqSpih1nMDf3lmPOnTrOgYaaOree87Zu3bVqlWr6jz/fP/w9Pnl@9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jOr373u3/@N/z/y8W7i5/e4wbvbz7e8ft/1KXX5frm9vbdv//rf/z2@qd3uMsVfsvL3t89vNw9Xzw@XHy4f/70cvH0eP/wEvf59NMdHvUF1375Nl9/d1zy/Phy83J38fJ4cXP7X59xzae7948Pt6@X3nx8@iPfGr15uXkol1@@vS7f4QbXWTfQl9/jFvyBfvjW//@2fIevn29u7z9/4rP/9PxyefP09PHPl19@X67z9afPP15dxcLe/@H@4fby/eOny9fbXV1ffLp/@MW/r/7B94pFf/h4//SLJb/88f75ryu@/4BlVqzzN0nGxFO46ndv9T988Jdj63cvn58fuIo3f3nz5s2/fK/XZPmG7N3DDy9/vPzrW7NXb@6en79//vzAzfDE0nX8Gqd8/z9/55sfb17@zjdvPjw@X97H8@4fABX518eXWjP@e8JluMPz/X//YiHffhtXfffd9cP7x4/vyvUf/gzfkS/QoA@4Ss70FAd8y/vcfDrFrW758u/T9eenp7tnO9Dt/c0PvvxKP/@A33/4@IgF3h73kPu8OrP8FJ8eJnldEhd8d/MQB31x@fT2y9XvmRBwmjpvguLNy@U3L3c4tF99c30RV15/c/G7f/vtr/HB39zz@pv/fPjmiuejK//py93zzQ93/N3j868vcIWeeFx2hTvx9z///H8 "R – Try It Online")
The core of the program is based on the [Metric Multi-Dimensional Scaling (MDS)](https://en.wikipedia.org/wiki/Multidimensional_scaling) approach, which solves precisely the problem described by the OP. The idea is to start from a collection of dissimilarities between entities and infer the coordinates of the system. Some post-processing is required to rotate, translate and flip the solution.
There are at least three functions available in R to perform MDS. There is also one in sklearn in Python, in case. In the code above I settled for the weighted mds variant (function wcmdscale), mostly due to the possibility to add weights and to a slightly better performing correction for negative eigenvalues. There is a core function in R, called cmdscale, which could be used instead, and would result in a score of 5.77.
The code provided is predisposed to accept weights, as well as noise in the floored distance matrix. After testing, it seemed best to not use any of these options.
~~Sadly, the package "vegan" is not available on TIO. So, no live demonstration: my apologies for this inconvenience.~~ Works on TIO like a charm.
Interestingly, the program significantly underperforms on the last two examples. Adding noise can help, but it worsens the performance on every other test case. It would be interesting to find out what makes these two test cases particularly difficult.
[Answer]
# [C++ (gcc)](https://gcc.gnu.org/), score = 5.94258
```
#ifndef _GLIBCXX_DEBUG
#define NDEBUG
#endif // _GLIBCXX_DEBUG
#include <iostream> //{ and more includes
#include <vector>
#include <string>
#include <sstream>
#include <array>
#include <cstdio>
#include <cmath>
#include <random>
#include <cassert>
#include <limits>
//}
template <typename T>
struct point { //{
    T x, y;
    point () {};
    point (T x1, T y1) : x (x1), y (y1) {};
    point operator+(point p) const { return point(x+p.x, y+p.y); }
    void operator+=(point p)       { x+=p.x; y+=p.y; }
    point operator-(point p) const { return point(x-p.x, y-p.y); }
    void operator-=(point p)       { x-=p.x; y-=p.y; }
    point operator*(T a)     const { return point(x*a, y*a);}
    void operator*=(T a)           { x *= a; y *= a; }
    T norm()                 const { return x * x + y * y; }
    T dot  (point p)         const { return x*p.x + y*p.y; }
    T cross(point p)         const { return x*p.y - y*p.x; }
    bool operator==(point<T> p1) const { return x==p1.x && y==p1.y;}
    bool operator!=(point<T> p1) const { return ! (*this == p1);}
    bool operator<(point<T> p1)  const {
        if (x != p1.x) return x < p1.x;
        return y < p1.y;
    }
    template <typename T1>
    operator point<T1> () const {
        return point<T1>(x, y);
    }
};
template <typename T>
std::istream& operator>> (std::istream& str, point<T>& pt) {
    str >> pt.x >> pt.y;
    return str;
}
template <typename T>
std::ostream& operator<< (std::ostream& str, point<T> pt) {
    str << "(" << pt.x << ", " << pt.y << ")";
    return str;
}//}
typedef point<double> pt;
//{ Additional functions, for point<real_type> only (specialize for double here)
double angle(pt p) {
	return std::atan2(p.y, p.x);
}
pt rotate(pt p, double angle) {
	double sin = std::sin(angle), cos = std::cos(angle);
	return pt(p.x * cos - p.y * sin, p.x * sin + p.y * cos);
}
pt normalize(pt p) {
	return p * (1/std::sqrt(p.norm()));
}
//}
std::array<bool, 0x80> const valid_double_start = [](){
	std::array<bool, 0x80> valid_double_start;
	for (size_t i = 0; i < valid_double_start.size(); ++i)
		valid_double_start[i] = false;
	for (char c = '0'; c <= '9'; ++c)
		valid_double_start[c] = true;
	valid_double_start['-'] = valid_double_start['.'] = true;
	// there are also 'e' and probably 'p' but they are not at
	// the begin of a double value string representation
	return valid_double_start;
}();
double score(std::vector<pt>const& pts1, std::vector<pt>const& pts2) {
	double result = 0;
	for (size_t i = 0; i < pts1.size(); ++i)
		result += (pts1[i] - pts2[i]).norm();
	return (result / pts1.size());
}
std::vector<std::vector<double>> distmatrix (std::vector<pt>const& pts) {
	std::vector<std::vector<double>> result (pts.size(), std::vector<double>(pts.size()));
	for (size_t i = 0; i < pts.size(); ++i) {
		for (size_t j = 0; j < i; ++j)
			result[i][j] = result[j][i] =
			std::floor(std::sqrt((pts[i] - pts[j]).norm()));
//		result[i][i] = 0; // implicit when initialize 'result' vector
	}
	return result;
}
std::vector<pt> normalize (std::vector<pt> pts) {
	for (size_t i = 1; i < pts.size(); ++i) pts[i] -= pts[0];
	pts[0] = {0, 0};
	double angle = - ::angle(pts[1]);
	for (size_t i = 1; i < pts.size(); ++i) pts[i] = rotate(pts[i], angle);
	pts[1].y = 0;
	if (pts[2].y < 0)
		for (size_t i = 2; i < pts.size(); ++i) pts[i].y = -pts[i].y;
	return pts;
}
unsigned nDiff (std::vector<std::vector<double>> mat1, std::vector<std::vector<double>> mat2, double eps = 1e-10) {
	unsigned result = 0;
	assert(mat1.size() == mat2.size());
	for (size_t i = 1; i < mat1.size(); ++i)
		for (size_t j = 0; j < i; ++j)
			result += std::abs(mat1[i][j] - mat2[i][j]) > eps;
	return result;
}
std::vector<pt> pts; // use global variable to print progress
int constexpr n_iteration = 200;
std::vector<pt> solve_with_seed (
	std::vector<std::vector<double>>const& distmatrix, int seed
) {
	std::mt19937 engine (seed);
	std::vector<pt> result; result.reserve(distmatrix.size());
	std::uniform_real_distribution<double> dist (-100, 100);
	for (size_t i = 0; i < distmatrix.size(); ++i)
		result.emplace_back(dist(engine), dist(engine));
	for (int iteration = 0; iteration < n_iteration; ++iteration) {
		#ifndef NDEBUG
		if (iteration % 10 == 0) {
			auto norm_result = normalize(result);
			std::clog << "Iteration " << iteration << "; "
			<< "score = " << score(norm_result, pts) << '\n';
			std::clog << "[";
			for (pt p : norm_result) std::clog << p << ", ";
			std::clog << "\b\b]";
			std::clog << " (nDiff = " << nDiff(distmatrix, ::distmatrix(norm_result)) << ")\n";
		}
		#endif
		for (size_t i = 1; i < pts.size(); ++i)
			for (size_t j = 0; j < i; ++j) {
				pt vec_IJ = result[j] - result[i];
				double dist = std::sqrt(vec_IJ.norm()),
				floor_expected = distmatrix[i][j];
				double ndist = (dist + (floor_expected + .5)) / 2;
				ndist = std::max(floor_expected, ndist);
				ndist = std::min(floor_expected + 1, ndist);
				double delta_dist = (dist - ndist) / 2;
				vec_IJ = normalize(vec_IJ) * delta_dist;
				result[i] += vec_IJ;
				result[j] -= vec_IJ;
//				std::clog << "Numerical error = " << std::sqrt((result[i] - result[j]).norm()) - ndist << '\n';
			}
	}
	return normalize(result);
}
std::vector<pt> solve (
	std::vector<std::vector<double>>const& distmatrix
) {
	// just going to try some random values of seed.
	std::vector<pt> result; int minDiff = std::numeric_limits<int>::max();
	for (int seed : {123456789,987654321,69850,68942,4162,12012}) {
		std::vector<pt> r = solve_with_seed(distmatrix, seed);
		int d = nDiff(distmatrix, ::distmatrix(r));
		if (d < minDiff) {
			minDiff = d;
			result = r;
		}
	}
	return result;
}
int main() {
	std::string str;
	double sumscore = 0; unsigned ntest = 0;
	while (std::getline(std::cin, str)) {
		if (str.empty()) break;
		std::stringstream sst (str);
		std::vector<double> values;
		while (true) {
			int c = sst.peek();
			while (c != EOF && !valid_double_start[c]) {
				sst.get();
				c = sst.peek();
			}
			if (c == EOF ) break;
			double val;
			if (!(sst >> val)) {
				std::clog << "Invalid input. Stop reading.\n";
				break;
			}
			values.push_back(val);
		}
		if (values.size() % 2 != 0) {
			std::clog << "Number of double values is odd: " << values.size()
			<< ". Assuming the last value (" << values.back() << ") is redundant.\n";
			values.pop_back();
		}
		pts.resize(values.size() / 2);
		for (size_t i = 0; i < pts.size(); ++i) {
			pts[i].x = values[2*i];
			pts[i].y = values[2*i+1];
		}
		if (pts.size() < 3) {
			std::clog << "Need at least 3 points. Ignore input.\n";
			continue;
		}
		auto distmatrix = ::distmatrix(pts);
		std::vector<pt> result_pts = solve(distmatrix);
		double score = ::score(pts, result_pts);
		std::cout << "Test #" << ++ntest << " score: " << score << ", "
		<< "number of difference in distance matrix: " << nDiff(distmatrix, ::distmatrix(result_pts)) << '\n';
		sumscore += score;
	}
	std::cout << "Final score = " << (sumscore / ntest) << '\n';
}
```
[Try it online!](https://tio.run/##nXtpb1xXkuVn8Vc8u9AlUhJTd1@sBeieXlCNQc@H8QANuAyBIlNyuqgkm5l0SWPot1efExH35SLKrhkDMjNfvneXuBEnTizv8vb2/P3l5d/@9ofVu/XV8t305t/@55/@6X/853@@@ed/@af/828nf8C11Xo5/Yd9Xa6vVu@m58@P7zv5w2p9eX1/tZxerm4227vlxYfXuO3X6WJ9NX24uVtO9vtm785flpfbm7vXe1fw5Gr9/uCKDbZ36eLu7uLT/oXLzfZqdXNw5cPF9qf9C3dYx83BKJcXm83ybrt/6Xr1YbXdvD55/vzzycl2@eH2@mKLy9tPt8v1xYfl9P3rE6zm/nI73d6s1tvpV@7wZMJ/308fn02fXshn/e30bPr188EF3OOf4c5P/mz6bvo4nX70Z3hoOuWFw3tvbpd3FxDN01P9fns2Xd6sN5zxbrm9v1vrfacfn94uODH@fDp7MX2WIX65WV3tRni1G0L/@3X6@PQVHnuBx/D303jscObz35v5XGc@/@rM5w/NfG4zn3995icQ1IU@8vDMTy4w75OLsxcPTPrk1e7pedLpyavpApPa3892Yuubuw@n@7dOD02Kp/HvKZ@ePu0evrrZTtPxBr98@Am2y4ef7G33@@ny7maz@bse/jSdy8Mfx8Nvb26u592@MhG//P71dOu/OKmPr17desz/xz9On@TjpxcPDPLNbw/yzXT6ZPvTajO9esWfHxrh5eEAY4STsS8AxunH6Rs@v/h4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zHjnJhC5B@1KzUAnrwF/7E346ysM0M//hs "C++ (gcc) – Try It Online")
The main part of the code is the `solve` function, which is given a floored distance matrix (as a 2D vector of `double`) and output a vector of `point<double>`. The rest of the code are score-calculator.
Idea: Start with a (seeded) random set of points, loop `n_iteration = 200` times the operation: For each pairs of point, get their current distance and expected distance (which is estimated to be equal to the distance in the floored input matrix `+ 0.5`), and then change the position of those two points to an appropriate position nearer to the expected distance.
For this program, the new length is calculated as `min(max((old_length + expected_length) / 2, expected_length + 0.5), expected_length - 0.5`, which is twice closer to the `expected_length` if the `old_length` is sufficiently close, and force it to change such that the absolute difference between new length and `expected_length` is no more than `1` if `old_length` is more than `2` units apart from the `expected_length`.
It also tries multiple seeds, and then pick the seed which gives least error in the resulting distance matrix.
]


[Question]
      [
Given an integer `n >= 2`, output the largest exponent in its prime factorization. This is OEIS sequence [A051903](https://oeis.org/A051903).
## Example
Let `n = 144`. Its prime factorization is `2^4 * 3^2`. The largest exponent is `4`.
## Test Cases
```
2 -> 1
3 -> 1
4 -> 2
5 -> 1
6 -> 1
7 -> 1
8 -> 3
9 -> 2
10 -> 1
11 -> 1
12 -> 2
144 -> 4
200 -> 3
500 -> 3
1024 -> 10
3257832488 -> 3
```

[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 2 bytes
```
ÓZ
```
[Try it online!](https://tio.run/##MzBNTDJM/f//8OSo//8NDYxMAA "05AB1E – Try It Online")
**How?**
```
Ó   exponents of prime factors
 Z  maximum
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~62~~ ~~57~~ 56 bytes
```
lambda n:max(k%n-n%(k/n+2)**(k%n)*n for k in range(n*n))
```
[Try it online!](https://tio.run/##RYyxDoIwGAZnfYpvaWhLifS3LiT6IupQo1WCfBACiT49ppPLJXfDjd/5NVDWhCMu6zv2t3sEmz5@dKdYUelux1KMtdmNJdIwoUNLTJHPh6alMWuO/Edx8HuDEmcfgoPUtcMhw9cSrs12M04tZxQqLKhOULIUUNB0SDrvfg "Python 2 – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 3 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
ÆEṀ
```
**[Try it online!](https://tio.run/##y0rNyan8//9wm@vDnQ3///83NDAyAQA "Jelly – Try It Online")**
```
ÆEṀ  - Full program / Monadic link.
ÆE   - Array of exponents of prime factorization.
  Ṁ  - Maximum.
```
This also works in [M](https://github.com/DennisMitchell/m). [Try it online!](https://tio.run/##y/3//3Cb68OdDf///zc0MDIBAA "M – Try It Online")
[Answer]
# [Ohm v2](https://github.com/MiningPotatoes/Ohm), 2 bytes
```
n↑
```
[Try it online!](https://tio.run/##y8/INfr/P@9R28T//w1NTAA "Ohm v2 – Try It Online")
## Explanation?
No.
[Answer]
# [Python 2](https://docs.python.org/2/), 78 bytes
```
n=input()
e=m=0
f=2
while~-n:q=n%f<1;f+=1-q;e=q*-~e;m=max(m,e);n/=f**q
print m
```
[Try it online!](https://tio.run/##BcFBDoMgEAXQPafopolQiUK6Ev9hXAyBpDMFg7HdeHV8r/xb@orvXZClHG3QisCYVYRXZ8ofuqwsFfKMqwvxBWdrIFRjLwoM3n4Dj6SDTIjGVFX2LO3BvbvZv28 "Python 2 – Try It Online")
-5 thanks to [ovs](https://codegolf.stackexchange.com/users/64121/ovs).
This answer doesn't do prime checks. Instead, it takes advantage of the fact that the highest exponent of a prime factor will be greater than or equal to the exponent of any other factor in any factorization of a number.
[Answer]
# [Haskell](https://www.haskell.org/), ~~61~~ ~~60~~ ~~50~~ ~~48~~ 46 bytes
-2 bytes thanks to [xnor](https://codegolf.stackexchange.com/users/20260/xnor)
```
f n=maximum[a|k<-[2..n],a<-[1..n],n`mod`k^a<1]
```
[Try it online!](https://tio.run/##HcZNCsIwEAbQq2Sp8BkyMVUL7RE8QYh2QIshnbH4Ay68eywuHrwbP8t1mmodjfbCnyxvifwt3SZ6azWBl9F/Osj9MpQTd5SqcFbTG@H5eDar@ZH1Zce1iR5bBDTYYY8DWpADEciDQoB3Ds2CnA@p/gA "Haskell – Try It Online")
### 45 bytes with an import:
```
import NumberTheory
maximum.map snd.factorize
```
[Try it Online!](https://tio.run/##DcmxDoIwFAXQ3a/oqMlN0z5aqQOfoJObMaZqCQ08IKUk6s9XhjOdzi99GIZSIs9TyuKy8jOkaxem9N21DftP5JUl@1ks41u2/pWnFH@hsI@jaMQW54fYzymOWbYHcSNUMLA4oobDCVpBa2iCNgakFOxGKzKoyNauIuPcvfwB)
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-h`](https://codegolf.meta.stackexchange.com/a/14339/), ~~9~~ 7 bytes
```
k ü mÊn
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LWg=&code=ayD8IG3Kbg==&input=MTQ0)
```
k ü mÊn     :Implicit input of integer
k           :Prime factors
  ü         :Group by value
    m       :Map
     Ê      :  Length
      n     :Sort
            :Implicit output of last element
```
[Answer]
# Mathematica, 27 bytes
```
Max[Last/@FactorInteger@#]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n6Zgq/DfN7Ei2iexuETfwS0xuSS/yDOvJDU9tchBOVbtf0BRZl6JgkNatLGRqbmFsZGJhUXsfwA "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [MATL](https://github.com/lmendo/MATL), 4 bytes
```
YFX>
```
[Try it online!](https://tio.run/##y00syfn/P9Itwu7/f0MTEwA "MATL – Try It Online")
```
       % implicit input
YF     % Exponents of prime factors
X>     % maximum
       % implicit output
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 5 bytes
```
ḋḅlᵐ⌉
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r//@GO7oc7WnMebp3wqKfz/39jI1NzC2MjEwuL/1EA "Brachylog – Try It Online")
### Explanation
```
ḋ          Prime decomposition
 ḅ         Group consecutive equal values
  lᵐ       Map length
    ⌉      Maximum
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), 5 bytes
```
▲mLgp
```
[Try it online!](https://tio.run/##yygtzv7//9G0Tbk@6QX///83NDAyAQA "Husk – Try It Online")
* `p` – Gets the prime factors.
* `g` – Groups adjacent values.
* `mL` – Gets the lengths of each group.
* `▲` – Maximum.
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), 19 bytes
```
⎕CY'dfns'
⌈/1↓2pco⎕
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qKM97f@jvqnOkeopaXnF6lyPejr0DR@1TTYqSM4HioMU/E/jsuDiSuMyNTAAUYYGRiYA "APL (Dyalog Unicode) – Try It Online")
**How?**
`2pco⎕` - 2D array of prime factors and exponents
`1↓` - drop the factors
`⌈/` - maximum
[Answer]
# Javascript 54 bytes
\*assuming infinite stack (as do in code-golf challenges)
```
P=(n,i=2,k)=>i>n?k:n%i?k>(K=P(n,i+1))?k:K:P(n/i,i,-~k)
console.log(P(2 )== 1)
console.log(P(3 )== 1)
console.log(P(4 )== 2)
console.log(P(5 )== 1)
console.log(P(6 )== 1)
console.log(P(7 )== 1)
console.log(P(8 )== 3)
console.log(P(9 )== 2)
console.log(P(10 )== 1)
console.log(P(11 )== 1)
console.log(P(12 )== 2)
console.log(P(144 )== 4)
console.log(P(200 )== 3)
console.log(P(500 )== 3)
console.log(P(1024 )== 10)
//console.log(P(3257832488 )== 3)
```
[Answer]
# PARI/GP, 24 bytes
```
n->vecmax(factor(n)[,2])
```
If I do not count the `n->` part, it is 21 bytes.
[Answer]
# [Octave](https://www.gnu.org/software/octave/), 25 bytes
```
@(n)[~,m]=mode(factor(n))
```
[**Try it online!**](https://tio.run/##y08uSSxL/Z9mq6en999BI08zuk4nN9Y2Nz8lVSMtMbkkvwgopvk/TcNYkytNwwREWIAIQxMw29DAyETzPwA "Octave – Try It Online")
### Explanation
`factor` produces the array of (possibly repeated) prime exponents
The second output of `mode` gives the number of times that the mode (i.e. the most repeated entry) appears.
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 7 bytes
```
eShMr8P
```
[Try it here.](http://pyth.herokuapp.com/?code=eShMr8P&input=1024&debug=0)
[Answer]
# [Python 2](https://docs.python.org/2/), ~~90~~ 84 bytes
```
f=lambda n,i=2,l=[0]:(n<2)*max(map(l.count,l))or n%i and f(n,i+1,l)or f(n/i,2,l+[i])
```
[Try it online!](https://tio.run/##DctBDsIgEIXhvaeYjQnYiQK2m0ZO0rBAa3USGBqCiZ4eZ/EW70@@/dfehV3vm08x39cIjOQdJr@YMCu@OX3K8aty3FU6P8qHGyatSwU@EkReYVMiBitVopwLofBhoaD7JomAGGrk11M5tFc9LHYc0RmDk8waN4b5ALBX4iaedP8D "Python 2 – Try It Online")
[Answer]
# [Gaia](https://github.com/splcurran/Gaia), 4 bytes
```
ḋ)⌠)
```
**[Try it online!](https://tio.run/##S0/MTPz//@GObs1HPQs0//83NgMA "Gaia – Try It Online")**
* `ḋ` - Computes the prime factorization as **[prime, exponent]** pairs.
	+ `⌠` - Map and collect the result with the maximal value.
	+ `)` - Last element (exponent).
	+ `)` - Last element (maximal exponent)
# [Gaia](https://github.com/splcurran/Gaia), 4 bytes
```
ḋ)¦⌉
```
[Try it online!](https://tio.run/##S0/MTPz//@GObs1Dyx71dP7/b2wGAA "Gaia – Try It Online")
* `ḋ` - Computes the prime factorization as **[prime, exponent]** pairs.
	+ `)¦` - Map with the last element (exponent).
	+ `⌉` - Gets the maximum element.
[Answer]
# [MY](https://bitbucket.org/zacharyjtaylor/my-language), 4 bytes
```
ωĖ⍐←
```
[Try it online!](https://tio.run/##y638//9855Fpj3onPGqb8P//fyMA "MY – Try It Online")
## Explanation?
```
ωĖ⍐←
ω    = argument
 Ė   = prime exponents
  ⍐  = maximum
   ← = output without a newline
```
[Answer]
# [Octave](https://www.gnu.org/software/octave/): 30 bytes
```
@(x)max(histc(a=factor(x),a));
```
1. `a=factor(x)` returns a vector containing the prime factors of `x`. This is a vector sorted in ascending order where the multiplication of all numbers in `factor(x)` yields `x` itself such that each number in the vector is prime.
2. `histc(...,a)` calculates a histogram on the prime factor vector where the bins are the prime factors. The histogram counts up how many times we have seen each prime number thus yielding the exponent of each prime number. We can cheat here a bit because even though `factor(x)` will return duplicate numbers or bins, only one of the bins will capture the total amount of times we see a prime number.
3. `max(...)` thus returns the largest exponent.
## [Try it online!](https://tio.run/##DczLCsMgFIThV5nlEbLwlsZWAn2P0sXBGCo0CokpeXvrbv5vMSVU/sWWMeOlYWAx4oYJDncoCaWgNJS10LKX1BZGj5Mz2jr39u1Jl9j4ok86aiCeVw617B0HFsK3texI/VrhgXxu8UtZDFgoiY6cD8p9Co@Yl87tDw "Octave – Try It Online")
[Answer]
# [Racket](https://racket-lang.org/), ~~83~~ 79 bytes
```
(λ(n)(cadr(argmax cadr((let()(local-require math/number-theory)factorize)n))))
```
[Try it online!](https://tio.run/##HYxLDsIwDAX3PYUlNvai4iMuZFKnjUgcsByJcjXuwJVC6VvNzOIZh7t4P2TWGWyXASeJSQViU@j4/aASBp4M2ebCL9gZszgS5ho4jybPlkygsC9HbeUmNvoi1VaKHLxaegspbes04MOSOuD//ny6XLf4Aw "Racket – Try It Online")
(I'm not sure if there's a consensus on what constitutes a complete Racket solution, so I'm going with the Mathematica convention that a pure function counts.)
### How it works
`factorize` gives the factorization as a list of pairs: `(factorize 108)` gives `'((2 2) (3 3))`. The second element of a pair is given by `cadr`, a shorthand for the composition of `car` (head of a list) with `cdr` (tail of a list).
I feel silly doing `(cadr (argmax cadr list))` to find the maximum of the second elements, but `max` doesn't work on lists: `(max (map cadr list))` doesn't do what we want. I'm not an expert in Racket, so maybe there's a standard better way to do this.
# Racket, 93 bytes
```
(λ(n)(define(p d m)(if(=(gcd m d)d)(+(p d(/ m d))1)0))(p(argmax(λ(d)(p d n))(range 2 n))n))
```
[Try it online!](https://tio.run/##LY1LCsNADEP3OYWhG5kumoRse5gh82FoYgaTQu/WO/RKEzsUvJCeLKRhfaWj37YghfQyA2LKVRLlt1DH7wvhP0KjSDujZjxRVtMUOTLuHuBxWZ54ZEZD0LKHj/ftw4tiWG0n0ezarvOAplUOgo9N47wYPAE "Racket – Try It Online")
### How it works
An alternative version that doesn't import `factorize` and instead does everything from scratch, more or less. The function `(p m d)` finds the highest power of `d` that divides `m` and then we just find highest value of `(p n d)` for `d` between `2` and `n`. (We don't need to restrict this to primes, since there will not be a composite power that works better than prime powers.)
[Answer]
## [Alice](https://github.com/m-ender/alice), 17 bytes
```
/o
\i@/w].D:.t$Kq
```
[Try it online!](https://tio.run/##S8zJTE79/18/nysm00G/PFbPxUqvRMW78P9/QxMTAA "Alice – Try It Online")
### Explanation
```
/o
\i@/...
```
This is just a framework for simple-ish arithmetic programs with decimal I/O. The `...` is the actual program, which already has the input on the stack and leaves the output on top of the stack.
Alice actually has built-ins to get the prime factorisation of an integer (even with prime-exponent pairs), but the shortest I've come up with using those is 10 bytes longer than this.
Instead the idea is that we repeatedly divide one copy of each distinct prime factor out of the input, until we reach **1**. The number of steps this takes is equal to the largest prime exponent. We'll be abusing the tape head as the counter variable.
```
w      Remember the current IP position. Effectively starts a loop.
  ]      Move the tape head to the right, which increments our counter.
  .D     Duplicate the current value, and deduplicate its prime factors.
         That means, we'll get a number which is the product of the value's
         unique prime factors. For example 144 = 2^4 * 3^2 would become
         6 = 2 * 3.
  :      Divide the value by its deduplicated version, which decrements the
         exponents of its prime factors.
  .t     Duplicate the result and decrement it. This value becomes 0 once we
         reach a result of 1, which is when we want to terminate the loop.
$K     Jump back to the beginning of the loop if the previous value wasn't 0.
q      Retrieve the tape head's position, i.e. the number of steps we've taken
       through the above loop.
```
[Answer]
# Julia, 60 52 40 bytes
```
f(x)=maximum(collect(values(factor(x))))
```
-12 +correction thanks to [Steadybox](https://codegolf.stackexchange.com/users/61405/steadybox)
[Answer]
# [Actually](https://github.com/Mego/Seriously), 4 bytes
```
w♂NM
```
[Try it online!](https://tio.run/##S0wuKU3Myan8/7/80cwmP9///w0NjEwA "Actually – Try It Online")
```
w♂NM  - Full program.
w     - Pushes the prime factorization as [prime, exponent] pairs.
 ♂N   - Get the last element of each (the exponents).
   M  - Maximum.
```
[Answer]
# [Python 2](https://docs.python.org/2/), 64 bytes
*-4 bytes thanks to H.PWiz.*
```
lambda n:max(a*(n%k**a<1)for a in range(n)for k in range(2,-~n))
```
[Try it online!](https://tio.run/##RYzLDoIwFET3fMVsTFpyTdqKLyJfoi6uEbRBLgS60I2/XgsbJ5nNmckZPuHZi4tNdYkv7m53hpQdvxXnSlZtnvPJ6qYfwfCCkeVRK1lA@weO1l/ROoZ6ChMqnB1hQygIW8KOsCccCEeCNak2NR1skXZnEtkac82y2eln52IpM6QMo5eARnkdfw "Python 2 – Try It Online")
Port of [H.PWiz's Haskell answer](https://codegolf.stackexchange.com/a/145941/68615). I'm only sharing this because I'm proud that I was able to understand this piece of Haskell code and translate it. :P
[Answer]
# Axiom, 61 bytes
```
f n==(a:=factors n;reduce(max,[a.i.exponent for i in 1..#a]))
```
This is the first time i find it is possible define the function
without the use of () parenthesis. Instead of "f(n)==" "f n=="
one character less...
[Answer]
# J, 9 bytes
```
[:>./_&q:
```
Max of `<./` all prime exponents `_&q:`
[Try it online!](https://tio.run/##Xc@/DsIgEAbwnaf44mBtYurdARZJ8EUcHIzEuBjT2WdHWxOaY2D4wf35eJY8IUUQfqdc4nk4XLfvWHqzGdDlFDvs8YnIkzHmfnu8sMuQHglcaTXdTKn0@vWoOWqGmbbypEcx6WrmxtLUuyWLW4MT6QW@vWCSpYdp/Z74MVhx4R@ufAE "J – Try It Online")
[Answer]
# APL(NARS), 15 chars, 30 bytes
```
{⌈/+/¨v∘=¨v←π⍵}
```
test:
```
  f←{⌈/+/¨v∘=¨v←π⍵}
  f¨2..12
1 1 2 1 1 1 3 2 1 1 2
  f¨144 200 500 1024 3257832488
4 3 3 10 3
```
comment:
```
{⌈/+/¨v∘=¨v←π⍵}
          v←π⍵    π12 return 2 2 3; assign to v the array of prime divisors of argument ⍵
      v∘=¨        for each element of v, build one binary array, show with 1 where are in v array, else puts 0
                  return one big array I call B, where each element is the binary array above
   +/¨            sum each binary element array of  B
 ⌈/               get the max of all element of B (that should be the max exponet)
```
]


[Question]
      [
[Life-like cellular automaton](https://en.wikipedia.org/wiki/Life-like_cellular_automaton) are cellular automaton that are similar to Conway's Game of Life, in that they operate on a (theoretically) infinitely large square grid, where each cell has exactly 8 neighbours, and is one of 2 states, namely alive and dead.
However, these Like-like versions are different in a crucial way: the rules for a given cell to come alive and the rules for a given cell to survive to the next generation.
For example, classic Game of Life uses the rule `B3/S23`, meaning that it takes 3 alive cells to birth a new one, and either 2 or 3 living neighbours to survive. For this challenge, we will assume that neighbours do not include itself, so each cell has exactly 8 neighbours.
Your task is, given a starting configuration, a birth rule, a survival rule and a positive integer (the number of generations to be run), simulate the Life-like automaton using those rules for the number of generations given in the shortest code possible. The starting configuration will be a square matrix/2-dimensional array or a multiline string, you may choose. The others may be given in any reasonable format and method.
For example, if the birth rule was `12345678` (any living neighbours), the survival rule was `2357` and the starting configuration was
```
0 0 0 0 0
0 0 0 0 0
0 0 1 0 0
0 0 0 0 0
0 0 0 0 0
```
the next two generations would be
```
Generation 1:           Generation 2:
0 0 0 0 0               1 1 1 1 1
0 1 1 1 0               1 1 0 1 1
0 1 0 1 0               1 0 1 0 1
0 1 1 1 0               1 1 0 1 1
0 0 0 0 0               1 1 1 1 1
```
If the number of generations given was 10, the output would be something along the lines of
```
0 1 1 1 0
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
0 1 1 1 0
```
You do not have to handle changes that happen outside of the bounds given by the input matrix, however, all cells outside the matrix begin dead. Therefore, the input matrix may be any size, up to the maximum value your language can support. You do not have to output the board between generations.
This is a [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the shortest code wins.
## Test cases
These use the `B/S` notation to indicate the rules used
`B2/S2`, `generations = 100`, configuration:
```
1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0
```
Output:
```
0 0 0 0 0 0 0 0
0 1 0 0 0 0 1 0
1 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
```
---
`B1357/S2468`, `generations = 12`, configuration:
```
1 0 1 0 1 0
0 1 1 0 1 0
1 0 0 0 0 0
0 0 0 0 0 1
1 1 1 1 1 0
0 1 1 0 0 1
```
Output:
```
0 1 0 0 0 0
0 1 1 1 1 0
0 1 0 1 1 0
1 1 1 0 0 0
0 0 1 1 1 0
0 1 1 0 0 0
```
If you need to generate more test cases, you can use [this](http://play.starmaninnovations.com/varlife/) wonderful simulator. Please make sure to limit the board size

[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~24~~ 23 bytes
```
xx:"tt3Y6Z+1Gm<8M2Gmb*+
```
Inputs are:
* Array with birth rule
* Array with survival rule
* Number of generations
* Matrix with initial cell configuration, using `;` as row separator.
[**Try it online!**](https://tio.run/##y00syfn/v6LCSqmkxDjSLErb0D3XxsLXyD03SUv7//9oQwUjBWMFEwVTBTMFcwWLWK5oEN9UwTyWy4gr2kABCq0V0JiGWEXBMBYA) Or see test cases: [**1**](https://tio.run/##y00syfn/v6LCSqmkxDjSLErb0D3XxsLXyD03SUv7//9oo1guEDY0MOCKNlRAgdYKBqjQWoEeKmIB), [**2**](https://tio.run/##y00syfn/v6LCSqmkxDjSLErb0D3XxsLXyD03SUv7//9oQwVjBVMF81iuaCMFEwUzBYtYLkMjLqCwgQIUW4MpOAfEgEJrBFPB0BqsCAKR9ADpWAA).
For a few bytes more you can see the [**evolution in ASCII art**](http://matl.suever.net/?code=xx%3A%221%26Xxtt3Y6Z%2B1Gm%3C8M2Gmb%2a%2BtZcD%5Dx&inputs=%5B2%5D%0A%5B2%5D%0A100%0A%5B1+1+1+1+1+1+1+1%3B+0+0+0+0+0+0+0+0%3B+1+1+1+1+1+1+1+1%3B+0+0+0+0+0+0+0+0%3B+1+1+1+1+1+1+1+1%3B+0+0+0+0+0+0+0+0%3B+1+1+1+1+1+1+1+1%3B+0+0+0+0+0+0+0+0%5D&version=20.4.2).
### Explanation
```
xx      % Take two inputs implicitly: birth and survival rules. Delete them
        % (but they get copied into clipboard G)
:"      % Take third input implicitly: number of generations. Loop that many times
  tt    %   Duplicate twice. This implicitly takes the initial cell configuration
        %   as input the first time. In subsequent iterations it uses the cell
        %   configuration from the previous iteration
  3Y6   %   Push Moore neighbourhood: [1 1 1; 1 0 1; 1 1 1]
  Z+    %   2D convolution, maintaining size
  1G    %   Push first input from clipboard G: birth rule
  m     %   Ismember: gives true for cells that fulfill the birth rule
  <     %   Less than (element-wise): a cell is born if it fulfills the birth rule
        %   *and* was dead
  8M    %   Push result of convolution again, from clipboard M
  2G    %   Push second input from clipboard G: survival rule
  m     %   Ismember: gives true for cells that fulfill the survival rule
  b     %   Bubble up the starting cell configuration
  *     %   Multiply (element-wise): a cell survives if it fulfills the survival
        %   rule *and* was alive
  +     %   Add: a cell is alive if it has been born or has survived, and those
        %   are exclusive cases. This produces the new cell configuration
        % Implicit end loop. Implicit display
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~144~~ 122 bytes
```
CellularAutomaton[{Tr[2^#&/@Flatten@MapIndexed[2#+2-#2[[1]]&,{#2,#3},{2}]],{2,{{2,2,2},{2,1,2},{2,2,2}}},{1,1}},#,{{#4}}]&
```
[Try it online!](https://tio.run/##LU3LCsIwELz7FYFAL67YRD0KFUHoQRDxFlZYbKqFNJUQQQj59rgFGXZeDOxI8WVHisODSr8vR@vcx1E4fOLE7eRNugWj77JaNydHMVrfnOnd@s5@bWe0XOqV1MYoxAqS1CA3GZLOiMyQ@BhzA@qvc87sFCgWyRu5zRmrcgmDj01vruS7aWx9tE8bjAKRVA1C1RnZahD8QKSZdrgoPw "Wolfram Language (Mathematica) – Try It Online")
Example usage:
```
%[RandomInteger[1, {10, 10}], {2, 3}, {3}, 5]
```
uses a 10x10 random grid as a start, survives with either 2 or 3 neighbors, births with 3 neighbors, plot result at 5 iterations.
[Answer]
# [R](https://www.r-project.org/), 256 bytes
```
function(x,B,S,r){y=cbind(0,rbind(0,x,0),0)
n=dim(y)[1]
z=c(1,n)
f=function(h){w=-1:1
b=h%%n+1
a=(h-b+1)/n+1
'if'(a%in%z|b%in%z,0,sum(x[w+b,w+a])-x[b,a])}
while(r){x=y
for(i in 1:n^2){u=f(i-1)
y[i]=u%in%B
y[i]=(y[i]&!x[i])|(x[i]&(u%in%S))}
r=r-1}
y[-z,-z]}
```
[Try it online!](https://tio.run/##bVHbboMwDH3PV7AH2lg4GumuquSX/kIfEZMKhRJpTSsGItD221nSAuumyYlvOT52krLfUZ/XOq3UQXODK1xjCaeW0kTpLQ@xHKzBEOximrZqz1uIZMw6SrlEDSyniaKAU0NCLiVLqPB9HUi2IV6IJJDw6KK5yud84yvtd@fkajDEr3rPTdQECTbBJgZhogStvbCmUJ8ZtxMZall@KLnylPbkUn8s4FRTzpWQwNpIxVQ7stXN507PHozVcObOzPj1fA2WtKRSyItFig5FF1/61fUiT/iCb8DWNljgM77iOzBDtwdgnkOEOGxAl3Dur4QLBhkRo8gRMcofDoewF6Hd8AlyAYxl5pilVbb1yBvHGEruukwkE@uEuc/IqdEPJvynasTY9sdS6Yq3YhwD@m8 "R – Try It Online")
Sadly, this does not look as golfed as I'd hoped.
**Input**: an R matrix, and the challenge parameters. **Output**: the matrix after R generations.
The algorithm pads the matrix with zeros to handle the boundaries. Then, iteratively: 1st) it applies the Birth rule and 2nd) it kills the pre-existing cells that did not pass the Survival rule. Padding is removed when returning.
[Answer]
# [Python 2](https://docs.python.org/2/), ~~156~~ ~~149~~ 146 bytes
```
lambda R,g,c:g and f(R,g-1,[[`sum(sum(l[y+y/~y:y+2])for l in c[x+x/~x:x+2])-c[x][y]`in R[c[x][y]]for y,_ in e(c)]for x,_ in e(c)])or c
e=enumerate
```
[Try it online!](https://tio.run/##vY/PisIwEMbv8xS5mdARm666S8GX8Dob1lhTFdpYuhWSi6/eTVRWA55lGMLvmz@Zr/PD4WSLsV59j41utzvN1rjHqtwzbXes5oGmEok2v@eWx2zIZ3528aXPCiXqU88adrSsIpe52cWVLsrTgIq82oTKmu6gYrPHn9hueCWu7J5YBK7ArIw9t6bXgxn/19ecJsUEQyqUeY4EJDEJhUA5JhGlN3eBEiWwrj/agbW64@HFRgBcFYDEj/xYfEZL8@VXdFXcTOV4z9t6@YwyvefxsUzPS2Zj9fVZ4x8 "Python 2 – Try It Online")
Takes input:
* `R`ules: `[birth,survial]` rules as list of `string`. eg.(`['135','246']`)
* `g`enerations: `int`
* `c`onfiguration: Square 2D array of `1/0` or `True/False`
Returns 2d array of `True/False`
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), ~~38~~ ~~36~~ 34 bytes (SBCS)
* Saved ~~2~~ 4 bytes thanks to [@ovs](https://codegolf.stackexchange.com/users/64121/ovs)!
```
{(((1⊥,)∊⍺(⍵+1)⊃⍨4⊃,)⍤⊢⌺3 3⍣⍵⍵)⍺⍺}
```
[Try it online!](https://tio.run/##JU07CsJAFOxziuncxSjZfEyuYOUZAhIRVhLUJkgqQSQkYmNp4wc8gB9I603eRdYXA/PewAwzE2d6MM1jnc7M902744bqhoHuXoyWCn5nZKnOk7nWSNIlVDR0eivWbyZpc0IIReXdlrQvOSw41VeSyi3VD5/JltxfXqhqPHhUX7ty2c0VxtDhNJ5wkWMt4jVzgIDqp2MJFy5VHxYlq8pScOHBR4ARQkQQ7CCBcuTfCBD@AA "APL (Dyalog Unicode) – Try It Online")
Can be invoked with `birth_rule (start_grid f epochs) survival_rule`, where `f` is the operator. Requires 0-indexing.
~~For some reason, using the trains `(+/,)` and `(4⊃,)` to make it 36 bytes [doesn't work](https://tio.run/##SyzI0U2pTMzJT///P@1R24RqDQ0NbX0dzUcdXRqPencB8VZtQ81HXc2PeldomABpHU1NzUc9u4wVjB/1LgbKApEmUCEQ1f5/1DsXZMaj3j6gwkPrjR@1TXzUNzU4yBlIhnh4Bv8H0p7@QBUGXLmJJUDaVMH0Ue8WAy4NIwWjRz3bgYKaQFFDLkMFIwVjBRMFUwUzBXMFCwUNoIxCmoKhgSZYwlTBHAA).~~ As ovs explained, it's because `⌺` calls functions dyadically. Anyway, their new solution is 34 bytes.
---
`⍣` can repeatedly apply a function some number of times, given a starting value. In this case, the starting value is the left operand, and the right operand tells it how many times to repeat.
`((1⊥,)∊⍺(⍵+1)⊃⍨4⊃,)⍤⊢⌺3 3` computes the next generation. The stencil operator (`⌺`) creates windows of a given shape (a 3x3 square here), applies a function on each of them, and puts them back together into a matrix. For cells on the edge of the grid, it will use zeroes, which works well with this challenge.
The train `((1⊥,)∊⍺(⍵+1)⊃⍨4⊃,)⍤⊢` is applied to each of those windows. `⍤⊢` applies the stuff before it to the second argument. `1⊥,` calculates the number of neighbors (including the cell) by turning the 2D window into a vector (`,`) and then summing it (`1⊥`). `∊` checks if that the number of neighbors is in either the birth rule or survival rule vector. Whether the birth rule or survival rule is chosen depends on the train `⍺(⍵+1)⊃⍨4⊃,`.
`4⊃,` turns the window into a vector and chooses the 5th cell, which is the cell we are calculating the next generation of. `⍺(⍵+1)` is an array where the first element is the birth rule and the second element is the survival rule, but with its elements increased by one (because we're including the current cell). Then `⊃⍨` uses the current cell/5th cell/middle cell to index into this array, so if the cell's dead (0) the birth rule will be used, and if the cell is alive (1) the survival rule will be used.
]


[Question]
      [
 For challenges related to the Swift language. Note that language specific challenges are generally discouraged.

Download Swift: <http://swift-lang.org/downloads/index.php>
]


[Question]
      [
Given an input list of non-empty strings, output an ASCII art representation of a tournament, based on the following drawing rules:
* The number of strings is guaranteed to be of quantity `2,4,8,16,etc.`
* The first two strings play each other, and the next two play each other, and so on. This is the first round.
* For each game, choose the winner randomly with equal probability.
* For the next round, the winner of the first game plays the winner of the second game, the winner of the third game plays the winner of the fourth game, and so on. Subsequent rounds follow the pattern.
* There is eventually one overall winner.
* For pretty output (required) the strings must all be prepended and appended with an underscore `_`.
* In order for the brackets to line up appropriately, each entry must be padded with `_` to all be the same length for that round.
* You can choose whether the padding is prepended or appended, so long as it's consistent.
* Instead, you can choose to pre-pad all strings to be the same length, rather than on a per-round basis. Whichever is golfier for your code.
## Further Rules
* Leading or trailing newlines or whitespace are all optional, so long as the characters themselves line up correctly.
* Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
* If possible, please include a link to an online testing environment so other people can try out your code!
* [Standard loopholes](http://meta.codegolf.stackexchange.com/q/1061/42963) are forbidden.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so all usual golfing rules apply, and the shortest code (in bytes) wins.
## Examples
Example with cities `['Boston', 'New York', 'Charlotte', 'Atlanta', 'St. Paul', 'Chicago', 'Los Angeles', 'Phoenix']`:
```
_Boston______
             \_New York____
_New York____/             \
                            \_New York_
_Charlotte___               /          \
             \_Charlotte___/            \
_Atlanta_____/                           \
                                          \_St. Paul_
_St. Paul____                             /
             \_St. Paul____              /
_Chicago_____/             \            /
                            \_St. Paul_/
_Los Angeles_               /
             \_Los Angeles_/
_Phoenix_____/
```
Example with `['Lions', 'Tigers', 'Bears', 'Oh My']`:
```
_Lions__
        \_Tigers_
_Tigers_/        \
                  \_Tigers_
_Bears__          /
        \_Bears__/
_Oh My__/
```

[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~92~~ 79 bytes
```
Ａ¹θＷＳ⊞υ⪫__ιＷυ«Ａ⌈ＥυＬκεＡ⁺θθδＦυ«Ｐ×_εＰκＭδ↓»ＡＥ✂υ¹Ｌυ²⎇‽²κ§υ⁺λλυＭε→Ｆυ«Ｍδ↑↗θ←↖θ→»Ｍθ↘Ａδθ
```
[Try it online!](https://tio.run/##ZVGxbsIwEJ3rr7CYbMlUoiOd0nahgioCOnRCVnIkVhw7xGegqvj21A6BgjpYJ7977947Oytlm1mpuy5xThWGTQTd8WdyKJUGymam8bjCVpmCcU5T70rmBX23yrDRZjMSVPE/tuf0hzwMgxbyqGpfh9pEyRxMgSWrOOeCQtBceKn2ju2iq6B5xLe2vYx6WHiNqgn2yNaqBhdMR1EeebfN6gzYPbBc0OmbPZiInG7SNGylVQYxy@QaxwfTp3DW0BrZfrOlNLmtWYQqQROcmRyOUdKn1IJq3i/g4/TeDoLdUhUl/ot@CfPZ9OHSPmi49ezzKw@s6Ry2eE@KyD3nanIanHfDotfGsGp@1p267sU6tIZ8wIF@2bYir@GztUUEkqCWBiVZ4SNNpdehpTJZWDK3jiamAA2OpKUFo46kG@@7sdO/ "Charcoal – Try It Online") Link is to verbose version of code. Needs a blank line to mark the end of the input. Explanation:
```
Ａ¹θ
```
Initialise the variable `q`. This holds the size of the zig-zags i.e. half the gap between rows.
```
ＷＳ⊞υ⪫__ι
```
Read nonblank input lines into the array `u`. The lines are automatically surrounded by `_`s as they are read in, although they are not padded yet.
```
Ｗυ«
```
Loop while there are still strings left.
```
Ａ⌈ＥυＬκε
```
Calculate the width of the largest string in `e`.
```
Ａ⁺θθδ
```
Calculate the gap between rows in `d`.
```
Ｆυ«Ｐ×_εＰκＭδ↓»
```
For each team, print the padding, print the team, and then move down to the next team.
```
ＡＥ✂υ¹Ｌυ²⎇‽²κ§υ⁺λλυ
```
For every other team, randomly pick between that team or the previous team. (Note that if there is only one team left then this produces an empty list.)
```
Ｍε→Ｆυ«Ｍδ↑↗θ←↖θ→»Ｍθ↘
```
If there are still teams left, draw the zigzags joining them in pairs.
```
Ａδθ
```
Double the length of the zigzags each time.
[Answer]
# [Python 2](https://docs.python.org/2/), ~~379~~ 364 bytes
```
exec r"""c=input();from random import*;R,L,d=range,len,0;u,s="_ ";r=[[""]*-~L(c)@R(2*L(c)-1)]
while c:
 W=2+max(map(L,c));j=1<<d;J=j/2;D=d+d;d+=1
 @r:l[D]=s*W;l[D-1]=s*J
 @R(L(c)):
	h=l*2*j+j-1;r[h][D]=(u+c[l]+u*W)[:W]
	@R(h-J,h+J):r[-~l][~-D]=("/\\"[l<h]+s*abs(h-l-(l<h))).rjust(J)
 c=[choice(l)@zip(c[::2],c[1::2])]
@r:print"".join(l)""".replace("@","for l in ")
```
[Try it online!](https://tio.run/##HZFNb9wgEIbP8a9AnMAfm9pHs0ibNidrVUXbwyoiqKKYBFwWLIyVbQ/717fjnuaZV8@gAeY/2cbQ3e/majRKGGPNXZjXTCh7T/GCkgojFHeZY8olO9XHeuQQfpjam1B/YWu9cPwTYZa4EBjLsrkdiaaHE@nKDZqWyuLTOm@Q7gt05l11UVdyUTM51ppSNvF2vx/ZwKfHjj3zsRrZWPG2QIfUe/Es@VKeGUDTbjhAfiLbwbQvHiz3ZVdO1dS0LAkrN52slRZeVmt5pqI/y@IBBmwz1LYaaJ9Ec/NS3JrNxI9vb1j4vZXVUqpfC2i@IdBTSndpWpdMBlogzYW20WlDPD38dTPRou87WWvRbhXuB6vOyYWM8W6KLoAHL7lLZvYKpvAB1/g9JuSRCwjT@x1/jUuOAeLv5hO9xvQb8JtVycecDfBT9ipkBfQj79CLWv1/wWn1EYGOcUFP8AfeLNC92GiCu@J/ "Python 2 – Try It Online")
]