Description Given a positive integer n, find two non-negative integers a, b such that a2 + b2 = n. Input The first line contains the number of test cases T (1 <= T <= 1000). For each test case, there is only one line with an integer n (1 <= n <…
Description 现在有两个单调递增序列,第一个序列有N个整数,第二个序列有M个整数,现在你可以从第一个序列中选一个数x,然后从第二个序列中选一个数y,那么有多少种情况满足x+y<=K呢? Input 输入包含多组数据. 对于每组测试数据,第一行包含两个整数N, M , K (1 <= N, M <= 105, 1 <= K <= 109),含义同上.接下来一行包含N个在[1, 109]范围内的整数,依次描述了第一个序列中的各个整数.再接下来一行包含M个在[1,…
Description My girlfriend loves 7 very much, she thinks it is lucky! If an integer contains one or more 7, she will think it is lucky too! Input The first line has one integer T (1 <= T <= 100), means there are T test cases. For each test case, t…
1514: Packs Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 61 Solved: 4[Submit][Status][Web Board] Description Give you n packs, each of it has a value v and a weight w. Now you should find some packs, and the total of these value is max, total of…