So heres a project ive been working on for about 2 weeks and thanks to the help of some people (Brenda, Joel, TheSaltyCop) its finally done!
Some math:Total number of materials:178.75 stacks of red concrete
90 stacks of torches
90 stacks of redstone torches
52.25 stacks of pistons
52.25 stacks of melon seeds
104.5 stacks of dirt
Output:out of 52 pillars 19 layers high with a 2.5 average number of melons per layer (if 100% lossless): 193 stacks of melons per harvest.