Comments

Taisia and dice i am getting wrong answer on test 1 but same code is working fine in ide,here is my code

include

include

using namespace std; int main() { int t; cin>>t; while(t--){ int n; cin>>n; int s; cin>>s; int r; cin>>r; int sum =0; vector ans; int th =6;

while( n>0 && sum <s){

      if(sum + th <= s){

           sum +=th;
           n--;

           if(sum == s && n !=0 && th > 0){

             sum = sum - th;
             n++;
             th--;


           }else if(th ==0){
               th++;
           }
           else{
               ans.push_back(th);

           }
      }else{
        //  cout<<n<<" "<< th<<endl;
          th--;
      }
}


for(int i=0;i<ans.size();i++){
    cout<<ans[i];
}
cout<<endl;

}

}