시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 12926 5391 4592 42.109%

문제

백준대학교에서는 대회에 나갈 때 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
W3sicHJvYmxlbV9pZCI6IjI4NzUiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWIzMDBcdWQ2OGMgb3IgXHVjNzc4XHVkMTM0IiwiZGVzY3JpcHRpb24iOiI8cD5cdWJjMzFcdWM5MDBcdWIzMDBcdWQ1NTlcdWFkNTBcdWM1ZDBcdWMxMWNcdWIyOTQgXHViMzAwXHVkNjhjXHVjNWQwIFx1YjA5OFx1YWMwOCBcdWI1NGMgMlx1YmE4NVx1Yzc1OCBcdWM1ZWNcdWQ1NTlcdWMwZGRcdWFjZmMgMVx1YmE4NVx1Yzc1OCBcdWIwYThcdWQ1NTlcdWMwZGRcdWM3NzQgXHVkMzAwXHVjNzQ0IFx1YWNiMFx1YzEzMVx1ZDU3NFx1YzExYyBcdWIwOThcdWFjMDBcdWIyOTQgXHVhYzgzXHVjNzc0IFx1YzZkMFx1Y2U1OVx1Yzc3NFx1YjJlNC4gKF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9wPlxyXG4iLCJvdXRwdXQiOiI8cD5UaGUgZmlyc3QgYW5kIG9ubHkgbGluZSBvZiBvdXRwdXQgbXVzdCBjb250YWluIG9ubHkgb25lIG51bWJlcjogdGhlIG1heGltdW0gbnVtYmVyIG9mIHRlYW1zIHdoaWNoIGNhbiBiZSBmb3JtZWQuJm5ic3A7PFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsInByb2JsZW1fbGFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

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

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