program struck_out
  implicit none
  integer :: n, m, k, i, j, l, s, t
  integer(8) :: a(100000), dp(0:100000,300), deq(100000), nxt
  a = 0_8
  dp = 0_8
  deq = 0_8
  read(*,*) n, m, k
  read(*,*) a(1:n)
  dp(1:n,1) = a(1:n)
  do j = 2, k
    s = 1
    t = 1
    do i = 1, n
      if (s.eq.t) then
        dp(i,j) = -1_8
      else
        dp(i,j) = int(j,8)*a(i)+dp(deq(s),j-1)
        if (i+1-deq(s).gt.m) s = s+1
      end if
      nxt = dp(i,j-1)
      if (nxt.ne.-1_8) then
        do while (s.ne.t.and.dp(deq(t-1),j-1).lt.nxt)
          t = t-1
        end do
        deq(t) = i
        t = t+1
      end if
    end do
  end do
  write(*,'(i0)') maxval(dp(1:n,k))
  stop
end program struck_out