This page is still under construction.

Parts of this page are still being built. What you see may change.

Facility Locations

Time limit1sMemory limit256 MB

Summary
Decide whether k candidate locations can be chosen so every client is served at zero cost.
Level

Medium6 of 10

Topics
Union-find, Math
Solved
No attempts yet

Problem

A company has nn clients and must serve all of them by opening kk facilities. An open facility serves any number of clients, and every client is assigned to one open facility. There are mm candidate locations for the facilities. Serving client jj from candidate location ii costs a non-negative integer cijc_{ij}, and the costs satisfy a locality condition: for any clients jj and j′j' and any candidate locations ii and i′i', cij≤ci′j+ci′j′+cij′c_{ij} \le c_{i'j} + c_{i'j'} + c_{ij'} holds.

The company eventually wants the cheapest way to open kk facilities. Right now it needs the answer to an earlier question. Decide whether it can open kk facilities and assign every client at a total cost of zero.

Input

The first line contains the integers mm, nn, kk, separated by spaces. (1≤m≤1001 \le m \le 100, 1≤n≤1001 \le n \le 100, 1≤k≤m1 \le k \le m)

Line ii of the next mm lines contains nn non-negative integers, the jj-th of which is cijc_{ij}. (0≤cij≤100000 \le c_{ij} \le 10000)

Output

Print yes if the company can open kk facilities and assign every client at a total cost of zero. Otherwise print no.

Examples2

  1. Example 1

    Input
    3 2 2
    0 2
    1 1
    2 0
    
    Expected output
    yes
    
  2. Example 2

    Input
    3 3 2
    0 2 2
    1 1 1
    2 2 0
    
    Expected output
    no