시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 3549 1585 1345 46.062%

문제

백준대학교에서는 대회에 나갈 때 2명의 여학생과 1명의 남학생이 팀을 결성해서 나가는 것이 원칙이다. (왜인지는 총장님께 여쭈어보는 것이 좋겠다.)

백준대학교는 뛰어난 인재들이 많아 올해에도 N명의 여학생과 M명의 남학생이 팀원을 찾고 있다.

그런데 올해에는 대회에 참여하려는 학생들 중 K명을 반드시 인턴쉽 프로그램에 참여하라는 학교의 방침이 생기게 되었다. 인턴쉽에 참여하는 학생은 대회에 참여하지 못한다.

백준대학교에서는 뛰어난 인재들이 많기 때문에, 많은 팀을 만드는 것이 최선이다.

여러분은 N명의 여학생과 M명의 남학생, K명의 인턴쉽에 참여해야하는 인원이 주어질 때 만들 수 있는 최대의 팀 수를 구하면 된다.

입력

첫째 줄에 N, M, K가 순서대로 주어진다. (0 ≤ M ≤ 100), (0 ≤ N ≤ 100), (0 ≤ K ≤ M+N),

출력

만들 수 있는 팀의 최대값을 출력하면 된다.

예제 입력 1

6 3 2

예제 출력 1

2
W3sicHJvYmxlbV9pZCI6IjI4NzUiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWIzMDBcdWQ2OGMgb3IgXHVjNzc4XHVkMTM0IiwiZGVzY3JpcHRpb24iOiI8cD5cdWJjMzFcdWM5MDBcdWIzMDBcdWQ1NTlcdWFkNTBcdWM1ZDBcdWMxMWNcdWIyOTQgXHViMzAwXHVkNjhjXHVjNWQwIFx1YjA5OFx1YWMwOCBcdWI1NGMgMlx1YmE4NVx1Yzc1OCBcdWM1ZWNcdWQ1NTlcdWMwZGRcdWFjZmMgMVx1YmE4NVx1Yzc1OCBcdWIwYThcdWQ1NTlcdWMwZGRcdWM3NzQgXHVkMzAwXHVjNzQ0IFx1YWNiMFx1YzEzMVx1ZDU3NFx1YzExYyBcdWIwOThcdWFjMDBcdWIyOTQgXHVhYzgzXHVjNzc0IFx1YzZkMFx1Y2U1OVx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GUgbnVtYmVyIG9mIGdpcmxzLCBOICgwICZsZTsgTiAmbGU7IDEwMCksIHRoZSBudW1iZXIgb2YgYm95cywgYW5kIEsgKDAgJmxlOyBLICZsZTsgTStOKSwgdGhlIG51bWJlciBvZiBjb21wZXRpdG9ycyB3aGljaCBoYXZlIHRvIGJlIHNlbnQgb24gYW4gaW50ZXJuc2hpcC48XC9wPlxyXG4iLCJvdXRwdXQiOiI8cD5UaGUgZmlyc3QgYW5kIG9ubHkgbGluZSBvZiBvdXRwdXQgbXVzdCBjb250YWluIG9ubHkgb25lIG51bWJlcjogdGhlIG1heGltdW0gbnVtYmVyIG9mIHRlYW1zIHdoaWNoIGNhbiBiZSBmb3JtZWQuJm5ic3A7PFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsInByb2JsZW1fbGFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

Contest > Croatian Open Competition in Informatics > COCI 2010/2011 > Contest #1 1번

  • 문제의 오타를 찾은 사람: kkorona
  • 문제를 번역한 사람: pl0892029