program struck_out
  implicit none
  integer :: n, m, k, i, j, l
  integer(8) :: a(100000), dp(0:100000,300)
  a = 0_8
  dp = 0_8
  read(*,*) n, m, k
  read(*,*) a(1:n)
  dp(1:n,1) = a(1:n)
  do j = 2, k
    do i = 1, n
      l = max(0,i-m)
      dp(i,j) = int(j,8)*a(i)+maxval(dp(l:i-1,j-1))
    end do
  end do
  write(*,'(i0)') maxval(dp(1:n,k))
  stop
end program struck_out