...

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;
#define ll long long
int T;
int m;
char s[30];
int date[7];
int a[10]={6, 1, 5, 5, 4, 5, 6, 3, 7, 6};
ll ans;
int fun(){
    date[2]+=1;
    int x=30;
    int t2=date[1];
    int t=date[0];
    if(t2==1||t2==3||t2==5||t2==7||t2==8||t2==10||t2==12) x=31;
    if(t2==2&&(t%4==0)&&(t%100!=0||t%400==0)){
        x=29;
    }
    else if( t2==2) x=28;
    if(date[2]>x) {
        date[2]=1;
        date[1]+=1;
    }
    if(date[1]>12) {
        date[1]=1;
        date[0]+=1;
    }
    int sum=0;
    int i=0;
    while(t){
        sum+=a[t%10];
        t/=10;
        i++;
    }
    sum+=(4-i)*6;
    i=0;
    while(t2){
        sum+=a[t2%10];
        t2/=10;
        i++;
    }
    sum+=(2-i)*6;
    i=0;
    int t3=date[2];
    while(t3){
        sum+=a[t3%10];
        t3/=10;
        i++;
    }
    sum+=(2-i)*6;
    return sum;
}
bool solve(){
    date[0]=(s[0]-'0')*1000+(s[1]-'0')*100+(s[2]-'0')*10+(s[3]-'0');
    date[1]=(s[4]-'0')*10+(s[5]-'0') ;
    date[2]=(s[6]-'0') *10+(s[7]-'0');
    if(m<8||m>48) return false;
    for(int i=0;;i++){
        int t=fun();
        if(date[0]>2999) return false;
        if(t==m) {
            ans=i;
            return true;
        }
    }
}
int main(){
    scanf("%d", &T);
    while(T--){
        scanf("%s", s);
        scanf("%d", &m);
        if(solve()){
            cout<<ans<<endl;
        }
        else cout<<"-1"<<endl;
    }
}


HE MAC Capabilities Information: 0x004082000103 .... .... .... .... .... .... .... .... .... .... .... ...1 = +HTC HE Support: Supported .... .... .... .... .... .... .... .... .... .... .... ..1. = TWT Requester Support: Supported .... .... .... .... .... .... .... .... .... .... .... .0.. = TWT Responder Support: Not supported .... .... .... .... .... .... .... .... .... .... ...0 0... = Dynamic Fragmentation Support: No support for dynamic fragmentation (0) .... .... .... .... .... .... .... .... .... .... 000. .... = Reserved: 0x0 .... .... .... .... .... .... .... .... .... ..01 .... .... = Reserved: 0x1 .... .... .... .... .... .... .... .... .... 00.. .... .... = Trigger Frame MAC Padding Duration: 0 (0) .... .... .... .... .... .... .... .... .000 .... .... .... = Multi-TID Aggregation Rx Support: 0 .... .... .... .... .... .... .... ...0 0... .... .... .... = HE Link Adaptation Support: No feedback if the STA does not provide HE MFB (0) .... .... .... .... .... .... .... ..0. .... .... .... .... = All Ack Support: Not supported .... .... .... .... .... .... .... .0.. .... .... .... .... = TRS Support: Not supported .... .... .... .... .... .... .... 0... .... .... .... .... = BSR Support: Not supported .... .... .... .... .... .... ...0 .... .... .... .... .... = Broadcast TWT Support: Not supported .... .... .... .... .... .... ..0. .... .... .... .... .... = 32-bit BA Bitmap Support: Not supported .... .... .... .... .... .... .0.. .... .... .... .... .... = MU Cascading Support: Not supported .... .... .... .... .... .... 0... .... .... .... .... .... = Ack-Enabled Aggregation Support: Not supported .... .... .... .... .... ...0 .... .... .... .... .... .... = Reserved: 0x0 .... .... .... .... .... ..1. .... .... .... .... .... .... = OM Control Support: Supported .... .... .... .... .... .0.. .... .... .... .... .... .... = OFDMA RA Support: Not supported .... .... .... .... ...0 0... .... .... .... .... .... .... = Maximum A-MPDU Length Exponent Extension: 0 .... .... .... .... ..0. .... .... .... .... .... .... .... = Reserved: 0x0 .... .... .... .... .0.. .... .... .... .... .... .... .... = Flexible TWT Schedule Support: Not supported .... .... .... .... 1... .... .... .... .... .... .... .... = Rx Control Frame to MultiBSS: Supported .... .... .... ...0 .... .... .... .... .... .... .... .... = BSRP BQRP A-MPDU Aggregation: Not supported .... .... .... ..0. .... .... .... .... .... .... .... .... = QTP Support: Not supported .... .... .... .0.. .... .... .... .... .... .... .... .... = BQR Support: Not supported .... .... .... 0... .... .... .... .... .... .... .... .... = PSR Responder: Not supported .... .... ...0 .... .... .... .... .... .... .... .... .... = NDP Feedback Report Support: Not supported .... .... ..0. .... .... .... .... .... .... .... .... .... = OPS Support: Not supported .... .... .1.. .... .... .... .... .... .... .... .... .... = A-MSDU Not Under BA in Ack-Enabled A-MPDU Support: Supported .... ..00 0... .... .... .... .... .... .... .... .... .... = Multi-TID Aggregation Tx Support: 0 .... .0.. .... .... .... .... .... .... .... .... .... .... = HE Subchannel Selective Transmission Support: Not supported .... 0... .... .... .... .... .... .... .... .... .... .... = UL 2x996-tone RU Support: Not supported ...0 .... .... .... .... .... .... .... .... .... .... .... = OM Control UL MU Data Disable RX Support: Not supported ..0. .... .... .... .... .... .... .... .... .... .... .... = HE Dynamic SM Power Save: Not supported .0.. .... .... .... .... .... .... .... .... .... .... .... = Punctured Sounding Support: Not supported 0... .... .... .... .... .... .... .... .... .... .... .... = HT And VHT Trigger Frame RX Support: Not supported 能判断是否支持OFDMA吗
07-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值