← Home
```go
package main

import (
    "fmt"
    "sort"
)

func main() {
    var n, k int
    fmt.Scan(&n, &k)
    
    l := make([]int, n)
    r := make([]int, n)
    
    for i := 0; i < n; i++ {
        fmt.Scan(&l[i], &r[i])
    }
    
    removed := make([]bool, n)
    cnt := 0
    
    for x := 1; x <= 200; x++ {
        type seg struct {
            r, idx int
        }
        active := []seg{}
        
        for i := 0; i < n; i++ {
            if !removed[i] && l[i] <= x && x <= r[i] {
                active = append(active, seg{r[i], i})
            }
        }
        
        sort.Slice(active, func(i, j int) bool {
            return active[i].r > active[j].r
        })
        
        for len(active) > k {
            removed[active[0].idx] = true
            cnt++
            active = active[1:]
        }
    }
    
    fmt.Println(cnt)
    
    result := []int{}
    for i := 0; i < n; i++ {
        if removed[i] {
            result = append(result, i+1)
        }
    }
    
    for i, idx := range result {
        if i > 0 {
            fmt.Print(" ")
        }
        fmt.Print(idx)
    }
    fmt.Println()
}
```