Imports System.Collections
Imports System.Collections.Generic
imports microsoft.visualbasic
Console.WriteLine(cint(x.tostring().replace(".", "")))
Console.WriteLine(cint(y.tostring().replace(".", "")))
Dim paired = elegantPair(prep(x), prep(y))
Console.WriteLine(paired)
Console.WriteLine(Encode(paired))
Public Function Prep(x As decimal) As long
return cint(x.tostring().replace(".", ""))
Public Function elegantPair(x As long, y As long) As long
Return If((x >= y), (x * x + x + y), (y * y + x))
Private Const Chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Public Function Encode(arg As Long) As String
Dim charArray As Char() = Chars.ToCharArray()
Dim result = New Stack(Of Char)()
result.Push(charArray(arg Mod 36))
Return New String(result.ToArray())
Public Function Decode(arg1 As String) As Long
Dim rev = StrReverse(arg1.ToUpper())
result += Chars.IndexOf(c) * CLng(Math.Pow(36, pos))