Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define fo(n) for(int i=0;i<n;i++)
- #define fos(o,n) for(int i=o;i<=n;i++)
- int main(){
- int n;
- while( cin >> n && n ){
- int ans = 1;
- bool no = 1;
- while( no ){
- map<int,bool> mp;
- int t = ans - 1 , closed = 0;
- bool p = 0;
- while( closed < n ){
- fo( n ){
- if( p ) break;
- if( mp[i] ) continue;
- ++t;
- if( t == ans ) {
- mp[i] = 1 , t = 0 , ++closed;
- if( i == 12 && closed < n ) p = 1;
- }
- }
- if( p ) break;
- }
- if(p) ++ans;
- else no = 0;
- }
- cout << ans << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement