Development of an Energy Determination Algorithm and the Optimized Detector Design for an Ultrahigh-Energy Cosmic Neutrino Experiment