[Question]
  [
You are working as an intern for a mathematician who *really* hates TeX, LaTeX, etc. So much so that he has decided to abandon all typesetting whatsoever and make you do all the formatting in ASCII. You got tired of this after a while and decided to start automating parts of it, starting with square roots.
Here's how a square root is made:
```
###  this is the input
###
###
_____  put a row of underscores stretching one character off either side on top
 ### 
 ### 
 ### 
   _____  put a diagonal of slashes in front going the height of the input
  / ### 
 /  ### 
/   ### 
      _____ put a diagonal of backslashes in front of that, going up half of the input's height rounded up
     / ###
 \  /  ###
  \/   ###
```
And that's it!
### Rules
You are to make a program or function that takes in a string, list of strings (i.e. lines), or array of characters, and outputs the input transformed according to the description above (not necessarily by the exact same order or process)
You may assume that the input is rectangular if preferred. Trailing whitespace is neither required nor disallowed.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest answer in bytes wins.
### Examples:
```
Input:
40
Output:
  ____
\/ 40
Input:
  ____
\/ 40
Output:
   ________
  /   ____
\/  \/ 40 
Input:
/| 
 | 
 | 
_|_
Output:
      _____
     / /|
    /   |
\  /    |
 \/    _|_
Input:
#  # 
#  # 
#####
   # 
   # 
Output:
        _______
       / #  #  
      /  #  #  
\    /   ##### 
 \  /       #  
  \/        #  
```
  
[Answer]
# [SOGL V0.12](https://github.com/dzaima/SOGL), 27 [bytes](https://github.com/dzaima/SOGL/blob/master/chartable.md)
```
1w⁄2+╔*00žl»╚;lH╚@Κ№↕h┼№↕;┼
```
[Try it Here!](https://dzaima.github.io/SOGLOnline/?code=JXUyMTkyMXcldTIwNDQyKyV1MjU1NCowMCV1MDE3RWwlQkIldTI1NUElM0JsSCV1MjU1QUAldTAzOUEldTIxMTYldTIxOTVoJXUyNTNDJXUyMTE2JXUyMTk1JTNCJXUyNTND,inputs=JTVCJTIyLyU3QyUyMCUyMiUyQyUyMiUyMCU3QyUyMCUyMiUyQyUyMiUyMCU3QyUyMCUyMiUyQyUyMl8lN0NfJTIyJTVE) (`→` added for ease-of-use; the program expects the input on stack)
[Answer]
# [Python 2](https://docs.python.org/2/), 196 bytes
```
x=Q=input()
l=len(x)
k=(l+1)/2
q=l+k
x=[[' ']*(q+1)+list(y)for y in x]
for i in range(k):x[i+l/2][i]='\\'
for j in range(l):x[j][q-j-1]='/'
print'\n'.join([' '*q+'_'*(2+len(Q[0]))]+map(''.join,x))
```
[Try it online!](https://tio.run/##Rc5NDoMgEAXgPadgNzOitbpswiFcI2ls0x@UIlqb4Omp2EU3k5eXL3nj1@U5ujrGIBtpnP8sSMxKe3MYiA0SraiorNkkrRhYkEoBB53htNXCmveCK93Hma/cOB40S9mkPHfuccOBTkEZYctaK6MltC3spP8Tm0iv1VT0RbWREpifjVugdXDoR@MwTWaTgDNkWIv0WqOOmkiLV@cRfioPRDEq6DiHHPhlv/wK@gs "Python 2 – Try It Online")
-2 bytes thanks to Step Hen
-13 bytes thanks to Jonathan Allan
[Answer]
# [Python 3](https://docs.python.org/3/), 138 147 Bytes
```
def f(l):h=len(l);w=len(l[0]);c=int(h/2);print('\n'.join([(h*2-c)*' '+w*'_']+[(i*' '+'\\'+(h-i-1)*2*' '+'/'+i*' ')[c:]+s for(i,s)in enumerate(l)]))
```
Variable 'l' is a list of strings, each string a line. Readable Version:
```
def f(l):
  height = len(l)
  width = len(l[0])
  half_height_floor = int(height / 2)
  print((height * 2 - half_height_floor) * ' ' + width * '_')
  for (index, line) in enumerate(l):
    #build a V based on the location of the line
    #surrounding V whitespace
    outer_space = index * ' '
   
    #inner V whitespace
    inner_space = (height - index - 1) * 2 * ' ' #inner v space
   
    #complete V
    v = outer_space + '\\' + inner_space + '/' + outer_space
   
    #left half_height_floor chars removed
    v_chopped = v[half_height_floor:]
   
    print(v_chopped + line)
```
Forms a square root symbol with a complete V then shaves off the left accordingly.
[Try it Online!](https://tio.run/##dY3BDoIwEETvfsXedrcFUbxB@JLSGMQ2rcFCAEP8@gp41cNk3swcZnjPrg@XGO/GgqWOC1d1JqxQLl9QJ81lW/kwk8tyLodxQ6wDHh@9D6TIiTxtWSCgXAReUUtFfo9Y1yjJpT49s8i/VYZyH1m1hZYT2H4kn0zsA5jwepqxmc16r5kPlhQ2AJgAwm3V5tCi5hh/D3/qDw)
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 32 bytes
```
ＷＳ⊞υιＰ⪫υ¶↖Ｐ×_⁺²⌈ＥυＬι↙↙Ｌυ↑↖÷⁺¹Ｌυ²
```
[Try it online!](https://tio.run/##VY5BD4IwDIXv/IoGLl0yDnLUKxcMJCTqzcQQnNJkDAIb@O8nA0Xs4aV57fvasiq6simktWNFUgAmqjX6pDtST2QMctNXaDgQO3iZkZraaaLx2JBytn9VPnOjZhC4v7SpeOj/zTPVokf/5nPIpekx4pAVL6pNjVnROkYq1FNXSGyuLytuRvWh5TNoddaE2V7@7S1fcEiUjmmgu8D58G6b4xBNYWsDgMBbxJUHrp3FhoMNe/kG "Charcoal – Try It Online") Link is to verbose version of code. 29-byte version that assumes rectangular input:
```
ＷＳ⊞υιＰ⪫υ¶↖Ｐ×_⁺²Ｌθ↙↙Ｌυ↑↖÷⁺¹Ｌυ²
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~131~~ 130 bytes
```
x=input()
n=len(x)
s=" "
for v in[s*2*n+"_"*(2+len(x[0]))]+[s*i+"\\"+s*2*(n+~i)+"/"+s*-~i+r for i,r in enumerate(x)]:print v[n/2:]
```
A full program taking a list of lines as input with the rectangular-only allowance (actually that the first line is one of the longest).
**[Try it online!](https://tio.run/##TY1BC4JAFITv/orXO7muaQhdBA91l36ALlHwpIV6K@tqdvGv22qHHJjDxwwz7cc9DGfzPBaa296FIuDiSRyOIugKBAwaY2EAzVUXZRFLvGIUZnKtVAclhJI@0RLrGuVSCVlOWkhMF9xPWlpYJnTszUDcv8jeHPkDlbdWs4Oh4jTL1TxXmBgm@CnBGBNwb7NFcA9L9Ec/3dsNQqMH2iCUp/J82a3on@9k4ehT9QU "Python 2 – Try It Online")**
[Answer]
# Java 8, 244 bytes
A very long solution, but probably close to the shortest for Java. This lambda takes lines of input as a `String[]` and returns a `String`. All lines must have the same length.
Based on the example outputs, I assumed that there's no need to append a space to each line in the input, so the program doesn't.
Thanks to *Jonathan Allan* for [reminding me](https://codegolf.stackexchange.com/a/135795/44945) about the `~` operator.
```
l->{int h=l.length,w=l[0].length(),a=h/2,i=w+3,x=h+a+h%2;String s="",t=s;for(;--i>0;)t+="_";for(;i++<x;)s+=" ";t=s+t;for(i=0;i<h;)t+="\n"+s.substring(0,i<a?x+~i:i-a)+(i<a?"":"\\"+s.substring(0,(h+~i)*2))+"/"+s.substring(0,i+1)+l[i++];return t;}
```
[Try It Online](https://tio.run/##bZDNbsIwEITPyVNYlirFtWNSesMxvfXWE0dAyEBClhonih1@RNNXT01Ce2h7m92ZHa2@vTqquKwys9@@d1Wz1rBBG62sRW8KDLqGQVXDUbkMWaecN/f@gDcONM8bs3FQGv56F@nM1WB28yVDg5qiHMlOx9MrGIcKqbnOzM4V7CT1PFnep4gwJYvRmIE80Wd2lgVVtHgYi6EEWYkxc9KKvKwjEccwTQRxVOIVHlZAaXoWxPoVwsInqesNkImAtBjCC4Op5bZZ2741Shik6uVMP2ECsSI0uo0YT/Bi8TsYFT5FHseEUDz600KfCNVz/8NS1JlraoOcaDsRenIDzju4YwlbdPBQo29MSNU7S26Mg9nFuuzAy8Zxz9s4baKcq6rSl8hkJ/RzccsGePSBMOsV@ketPla9agkRYdCGbfcF)
## Ungolfed
```
l -> {
    int
        h = l.length,
        w = l[0].length(),
        a = h / 2,
        i = w + 3,
        x = h + a + h % 2
    ;
    String
        s = "",
        t = s
    ;
    for (; --i > 0; )
        t += "_";
    for (; i++ < x; )
        s += " ";
    t = s + t;
    for (i = 0; i < h; )
        t +=
            "\n"
            + s.substring(0, i < a ? x + ~i : i - a)
            + (i < a ? "" : "\\" + s.substring(0, (h + ~i) * 2))
            + "/"
            + s.substring(0, i + 1)
            + l[i++]
        ;
    return t;
}
```
## Acknowledgments
* -2 bytes thanks to *Kevin Cruijssen*
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal) `a`, 67 bytes
```
L3*½⌈ð*₴⁰hL⇧\_*,ƛ¥⁰L½⌊-:0≥[:ð*\\+₴⁰L½⌈ε‹|_⁰L½⌈]&›ð*₴⁰L¥εð*\/¥ð*++₴,
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=a&code=L3*%C2%BD%E2%8C%88%C3%B0*%E2%82%B4%E2%81%B0hL%E2%87%A7%5C_*%2C%C6%9B%C2%A5%E2%81%B0L%C2%BD%E2%8C%8A-%3A0%E2%89%A5%5B%3A%C3%B0*%5C%5C%2B%E2%82%B4%E2%81%B0L%C2%BD%E2%8C%88%CE%B5%E2%80%B9%7C_%E2%81%B0L%C2%BD%E2%8C%88%5D%26%E2%80%BA%C3%B0*%E2%82%B4%E2%81%B0L%C2%A5%CE%B5%C3%B0*%5C%2F%C2%A5%C3%B0*%2B%2B%E2%82%B4%2C&inputs=40&header=&footer=)
**Don't ask how it works**. It's a giant mess.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), ~~40~~ 32 bytes
```
ẏṘ\\$꘍øm↵:IǏfL:£Nvȯ$Z¥?hL⇧\_*꘍p⁋
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLhuo/huZhcXFxcJOqYjcO4beKGtTpJx49mTDrCo052yK8kWsKlP2hM4oenXFxfKuqYjXDigYsiLCIiLCJbXCI0MFwiXSJd) or [verify all test cases](https://vyxal.pythonanywhere.com/#WyJQIiwixpsiLCLhuo/huZhcXFxcJOqYjcO4beKGtTpJx49mTDrCo052yK8kWsKlbmhM4oenXFxfKuqYjXDigYsiLCI7wqhaJOKBi2BJbnB1dDpcXG5gcCRgXFxuT3V0cHV0OlxcbmBwyK87YFxcblxcblxcbmBqIiwiW1tcIjQwXCJdLCBbXCIgIF9fX19cIixcIlxcXFwvIDQwIFwiXSwgW1wiL3wgXCIsXCIgfCBcIixcIiB8IFwiLFwiX3xfXCJdLCBbXCIjICAjIFwiLFwiIyAgIyBcIixcIiMjIyMjXCIsXCIgICAjIFwiLFwiICAgIyBcIl0sIFtcImFiXCIsXCJjZFwiLFwiZWZcIl1dIl0=).
*-8 bytes from porting 05AB1E*
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 46 bytes
```
l *2
£Vç hY'\ h~Y'/ +S+XÃuVç +'_p2+Ug l¹msV/4
```
Leading newline is part of the program. Input and output is an array of strings representing lines.
[Try it online!](https://codepen.io/justinm53/full/NvKjZr?code=CmwgKjIKo1bnIGhZJ1wgaH5ZJy8gK1MrWMN1VucgKydfcDIrVWcgbLltc1YvNA==&inputs=WyI0MCJd,WyIgIF9fX18iLCAiXC8gNDAgIl0=,WyIvfCAiLCAiIHwgIiwgIiB8ICIsICJffF8iXQ==,WyIjICAjICIsICIjICAjICIsICIjIyMjIyIsICIgICAjICIsICIgICAjICJd&flags=LVI=) using the `-R` flag to join the resulting array with newlines.
[Answer]
## JavaScript (ES6), 140 bytes
Takes input as an array of strings / returns an array of strings.
```
a=>[a[0].replace(/./g,'_'),...a].map((r,y)=>[...a,...a].map((_,x)=>x-y+1|y-.5<l/2?l*2-x-y?' ':'/':'\\',c=y?' ':'_').join``+c+r+c,l=a.length)
```
### Test cases
```
let f =
a=>[a[0].replace(/./g,'_'),...a].map((r,y)=>[...a,...a].map((_,x)=>x-y+1|y-.5<l/2?l*2-x-y?' ':'/':'\\',c=y?' ':'_').join``+c+r+c,l=a.length)
console.log(
  f([
    '40'
  ]).join`\n`
)
console.log(
  f([
    '  ____',
    '\\/ 40 '
  ]).join`\n`
)
console.log(
  f([
    '/| ',
    ' | ',
    ' | ',
    '_|_'
  ]).join`\n`
)
console.log(
  f([
    '#  # ',
    '#  # ',
    '#####',
    '   # ',
    '   # '
  ]).join`\n`
)
```
[Answer]
# [Perl 5](https://www.perl.org/), 177 185 160 bytes
```
$s=$f=int((@t=<>)*1.5+.5);print" "x$f;print"_"x length$t[0];print"_
";$b=-int(@t/2);for(0..$#t){--$s;print$_==$s?"/":$_==$b?"\\":" " for 0..$f;print$t[$_];++$b}
```
[Try it online!](https://tio.run/##bU1LCoMwFNx7ivB8C1NJtIVsTFO9R5WAoG1BrMS3EErPnkZrd53NDMN8ps4NynucDfbmMVKSVGTOF344SpVKxfXkggsMFux3bWFhQzfe6I50zZufG4HG1oh1o6LsxHX/dEkuJcbEX0Lg/A2iNQbnEjIoNtmWUNdQhAcWCmwt7EdhHW2j0xTbt/fxhugffQA "Perl 5 – Try It Online")
Changelog:
* needed more bytes to fix a bug (it assumed a *square* input first)
* fixed another bug and used some tips from comments (thanks Dada!)
[Answer]
# [C (clang)](http://clang.llvm.org/), ~~169~~ 151 bytes
*-18 thanks to @[ceilingcat](https://codegolf.stackexchange.com/users/52904)*
```
#define P printf("%*c"
i;k;f(**l,c){P,i=c+c-c/2,32);for(k=strlen(*l)+3;--k;)P,1,95);for(;P,1,10),k<c;P"%s",k,32,*l++))P,i-k-P,k++<c/2?0:k-c/2,92),47);}
```
[Try it online!](https://tio.run/##VZBBboMwEEX3nGJkFMnGYwGGqkod1CuwbyqEHGgtU1oBO8LZqSEkLbOZ@X/eH1nWQjdl@zHP/qWqTVtBDj@daYeakkOgiWeUVTUNggY1G3M0meZa6FBiIpmqvztqs37omqqlQcN4ooSwiuUY4/HptleLiCOG9qRVTg49QevCGDScM0caYUWOlvOTu/oavdj1@lEyTJ@Zmuav0rSUjZ7@LLsAhqof4rd3yGAkaUQm9c@Xmw9QuCII5HwOIY1gjyUbFl5hYWDXimuxp9ON9gH8lfgbllqjd@c2uHhN13cixOwuJIJ8iAQhfYgUwX2VN82/ "C (clang) – Try It Online")
[Answer]
## C++, 291 bytes
The function assumes that all the strings in the vector passed as parameter have the same length
```
#include<vector>
#include<string>
#define S std::string
#define T size()
void f(std::vector<S>&c){c.insert(c.begin(),S(c[0].T+1,'_'));int i,j=0;for(i=1;i<c.T;++i){c[i]='/'+S(i,' ')+c[i];if(i>=c.T/2)c[i]='\\'+S((c.T-i-1)*2,' ')+c[i];}for(auto&a:c)j=j>a.T?j:a.T;for(auto&a:c)a=S(j-a.T,' ')+a;}
```
[Answer]
# Dyalog APL, 95 bytes
```
{((' '/⍨y+x),'_'/⍨2+⊃⌽⍴⍵)⍪⍉(x-y)↓⍉(⊖(x(-x)↑⌽y y⍴'\',' '\⍨y←⌈x÷2),x x⍴'/',' '\⍨x←⊃⍴⍵),' ',⍵,' '}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R24RqDQ11BXX9R70rKrUrNHXU48FsI@1HXc2PevY@6t3yqHer5qPeVY96OzUqdCs1H7VNBjEfdU3TqNDQrQDyJwLVVSpUApWqx6jrAA2LARkGNPpRT0fF4e1GmjoVChUgWX24bAVIFmgBxHSQqA6QAaJrga5SMFEwAalXVudKUzBGYpugsI3BZtYoKIBRfE28OgA)
[Answer]
**C, 485 bytes**
This program takes up to 999 characters from standard input and reads them into an array. It prints them 1 at a time to standard output with the changes your challenge indicated. It assumes the input is rectangular.
```
#include<stdio.h>
#define p(a)putc(a,stdout);
#define P j+j/2+1
a[999],i,j,k,l,m,n,q;char c;pad(a){m=P;if(a&&!k){m-=1;}for(n=0;n!=m;n++){q=32;if((!a||k)&&n==c){c--;q=47;}else if((P-c+1)>j/2+1&&(P)/2-n==c-2){q=92;}p(q);}}int main(){k=i=j=0;x:if(read(0,&c,1)){if('\n'==(a[i++]=c)){if(!j){l=i;}j++;}goto x;}i--;if('\n'==a[i-1]){i--;}else{j++;}c=P-2;for(;k!=i;k++){if(!k||a[k]==10){if(a[k]==10){p(10);}pad(1);if(!k){l++;while(l-->0){p(95);}p(10);pad(0);}if(a[k]==10){continue;}}p(a[k]);}}
```
[Answer]
# [Perl 5](https://www.perl.org/), 159 bytes
```
@a=map{$m=(y///c)>$m?y///c:$m;$_}<>;$_=$"x($l=@a/2-.5).'\\/'.$"x@a;for$i(1..@a){$a[-$i]=$_.$a[-$i];s| \\|\\ |;s|/ | /|;$i>$l&&y/\\/ /}chop;say$_.'_'x++$m,$/,@a
```
[Try it online!](https://tio.run/##LYxBCsIwFET3niLIx7a0zTe23RhTcwFPYKQEUSw0JrQuLMarG4O4mXk8mHGXcWhCkFoY7V5gRDoj4jlrwex/tAXDoXvv2pgCls8UBiE1bkraZDRRChMardT8akfoU0ap1NkL9LGE/iSgo3/kkydKeaWIj4jEE/Qc@haG1WrG@EPwfb5Zxyc9x1XSJc88B1MAFlKHwDbVoqqbRV2x2Oxj3aO39ymUh4au2foL "Perl 5 – Try It Online")
[Answer]
# [Canvas](https://github.com/dzaima/Canvas), 26 [bytes](https://github.com/dzaima/Canvas/blob/master/files/chartable.md)
```
Ｌ├_×；∔ｒ↔ｌ╷＼ ；∔＋ｌ½：／； ＊；∔＋↔
```
[Try it here!](https://dzaima.github.io/Canvas/?u=JXVGRjJDJXUyNTFDXyVENyV1RkYxQiV1MjIxNCV1RkY1MiV1MjE5NCV1RkY0QyV1MjU3NyV1RkYzQyUyMCV1RkYxQiV1MjIxNCV1RkYwQiV1RkY0QyVCRCV1RkYxQSV1RkYwRiV1RkYxQiUyMCV1RkYwQSV1RkYxQiV1MjIxNCV1RkYwQiV1MjE5NA__,i=JTVCJTIyJTIzJTIwJTIwJTIzJTIwJTIyJTJDJTIyJTIzJTIwJTIwJTIzJTIwJTIyJTJDJTIyJTIzJTIzJTIzJTIzJTIzJTIyJTJDJTIyJTIwJTIwJTIwJTIzJTIwJTIyJTJDJTIyJTIwJTIwJTIwJTIzJTIwJTIyJTVE,v=8)
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 35 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
ā<R'\úíº.c.BD2äĆ˜g©δ.£søIнgÌ'_×®úš»
```
Input as a rectangular list of strings-lines (rectangular isn't completely necessary, as long the first line is the longest).
[Try it online](https://tio.run/##yy9OTMpM/f//SKNNkHrM4V2H1x7apZes5@RidHjJkbbTc9IPrTy3Re/Q4uLDOzwv7E0/3KMef3j6oXWHdx1deGj3///RSvo1Cko6SgpIZHxNvFIsAA) or [verify all test cases](https://tio.run/##yy9OTMpM/V@m5JlXUFpipaBkX6nDpeRfWgLh6VT@P9JoE6Qec3jX4bWHdukl6zm5GB1ecqTt9Jz0QyvPbdE7tLj48I7KC3vTD/eoxx@efmjd4V1HFx7a/V/n0Db7/9HRSiYGSrE6CtFKCgrxQKCkoxQTo69gYqAAEdWvAVqhpIBExtfEQ6SUFRSUQQJwGgRAyqB8CA1WmpgE5CenAInUNKXYWAA) or [see the step-by-step output](https://tio.run/##XVSxbhNBEO35ipEbG8kJISUQIYWACAgpCmUSOePz2LfovLvs7uUwSkOTip6GBkFDQSqEEIjmDBUS4o/M7M5dcqGxrPWbt2/ee2vjcaxotertaluGW9AbbtVf7l7r7ZU@B4RC@QBKQ8gJHOoZwcHNIR8wdq0gPQv5UZz5@UqmdihzhJ4gmO7IxhAEfD2C7wh2n07I/Q8dCG4IG4l3vyOmf9iHSoWc0RhgjnrBpDhRegbeYkY@DvQPl9@u0hNmOXi5Q3CAjm91qAqejUPLTzLyRDlnXJqIx3XDdI80owv1kuWpuS1UpkKxgGdGaQ/jBWiqmIl8Wm49k6Ft8wJUgIFnfACjL1BDQD0BnEwuJLSyqpxYmCb@7tEthG67MbaM92IgGRfWuFJm7ILziCZWBuh5icWaZ6kTsOiCh4GwRuhUOQ4zHoPyUKCbkYMpL2xYjPguO@xsLj/Itfd1VhhPtwGtJb5XMaOpNORsfMr9THAPCgyBdDz6/bbJzNgk1cbs4vVyAwyS/mBYlErVOkGncFwQHNfnxylhU7JMYy17k/TM6o/C@ZjIduK/MDDL0WEWOG@YOjNvMg@uyffP5/X6vTA8rdCKhbGogdgOdqXtFbXN5tbHQb/82ingpYctSjdx2O6u0SPZNVLs/v2xNROSXd08Dt6ba7OZqvdafnuIJ8TPTTSDmXa27I/6qdmj5ZtGDE7Eq7b@ODelDnHq8iHU5@1D2HPUZNc@tXa9X@8E8YibLJ4prbkT6dGzQmGTFXlO/gVE4pXic6ZTNp8LrJijIsjjNqbkZpWBnUoh1t@Hq9VB78Ypf@9B53N0Ouod/QM).
**Explanation:**
```
ā             # Push a list in the range [1, (implicit) input-length]
 <            # Decrease each by 1 to the range [0, length)
  R           # Reverse it to the range (length, 0]
   '\        '# Push string "\"
     ú        # Pad "\" with the integer amount of leading spaces
      í       # Reverse each, so the spaces are trailing
       º      # Mirror each line
        .c    # Centralize (implicitly joins by newlines)
          .B  # Box it (split on newlines, and add trailing spaces)
D             # Duplicate it
 2ä           # Split it into two equal-sized parts (where the first is longer
              # for odd-length lists)
   Ć          # Enclose: append its own head
    ˜         # Flatten
     g        # Pop and push the length
      ©       # Store it in variable `®` (without popping)
       δ      # Map over each string:
        .£    #  Only leave the last `®` amount of characters
s             # Swap so the input-list is at the top
 ø            # Create pairs of the two lists
  Iн          # Push the first line of the input-list
    g         # Pop and push its length
     Ì        # Increase it by 2
      '_×    '# Pop and push a string of that many "_"
         ®ú   # Pad `®` amount of leading spaces
           š  # Prepend it to the list
            » # Join each inner list by spaces, and then the strings by newlines
              # (after which the result is output implicitly)
```
`2äĆ˜g` could alternatively be `gD;î+` for the same byte-count (length; duplicate; halve; ceil; sum together): [try it online](https://tio.run/##yy9OTMpM/f//SKNNkHrM4V2H1x7apZes5@SS7mJ9eJ32oZXntugdWlx8eIfnhb3ph3vU4w9PP7Tu8K6jCw/t/v8/Wkm/RkFJR0kBiYyviVeKBQA).
]