Description

Consider the AC circuit below. We will assume that the circuit is in steady-state. Thus, the voltage at nodes 1 and 2 are given by v1 = VS coswt and v2 = VRcos (wt + q ) where VS is the voltage of the source, w is the frequency (in radians per second), and t is time. VR is the magnitude of the voltage drop across the resistor, and q is its phase. 

You are to write a program to determine VR for different values of w. You will need two laws of electricity to solve this problem. The first is Ohm's Law, which states v2 = iR where i is the current in the circuit, oriented clockwise. The second is i = C d/dt (v1-v2) which relates the current to the voltage on either side of the capacitor. "d/dt"indicates the derivative with respect to t. 

Input

The input will consist of one or more lines. The first line contains three real numbers and a non-negative integer. The real numbers are VS, R, and C, in that order. The integer, n, is the number of test cases. The following n lines of the input will have one real number per line. Each of these numbers is the angular frequency, w. 

Output

For each angular frequency in the input you are to output its corresponding VR on a single line. Each VR value output should be rounded to three digits after the decimal point.

Sample Input

1.0 1.0 1.0 9
0.01
0.031623
0.1
0.31623
1.0
3.1623
10.0
31.623
100.0

Sample Output

0.010
0.032
0.100
0.302
0.707
0.953
0.995
1.000
1.000
/*
一道无聊的数学题
推导出公式即可
*/
#include<iostream>
#include<cmath>
#include<stdio.h>
using namespace std; int main()
{
double vs, r, c;
int n;
cin>>vs>>r>>c;
cin>>n; while(n-->0)
{
double w;
cin>>w; double vr = r*c*w*vs*sqrt(1/(r*c*w*r*c*w+1)); printf("%.3lf\n", vr);
} return 0;
}

  

最新文章

  1. [LeetCode] Two Sum III - Data structure design 两数之和之三 - 数据结构设计
  2. Qt中常见错误整理(不定期更新)
  3. PHP常用函数(1)
  4. 性能测试学习之三—— PV-&gt;TPS转换模型&amp;TPS波动模型
  5. Linux下SVN安装配置和使用中遇到的问题
  6. C++ 简单 Hash容器的实现
  7. vim退出
  8. NSIntger CGFloat NSNumber
  9. 手把手教你玩转SOCKET模型之重叠I/O篇(上)
  10. Python爬虫(二十)_动态爬取影评信息
  11. c# 7.0 6.0 新语法
  12. jQuery轮播图--不使用插件
  13. C# Note18: 使用wpf制作about dialog(关于对话框)
  14. ionic3 title 不居中问题
  15. HIHOcoder 1441 后缀自动机一&#183;基本概念
  16. 《算法》第四章部分程序 part 1
  17. python3.5 中Django框架连接mysql
  18. Node.js程序在node-windows中不能运行
  19. JavaScript debugger 语句
  20. AlexNet 2012

热门文章

  1. [置顶] JVM层对jar包字节码加密
  2. SSH服务及其扩展(sshpass和expect)
  3. BZOJ5125: [Lydsy1712月赛]小Q的书架(DP决策单调性)
  4. HihoCoder - 1496:寻找最大值(高维前缀和||手动求子集)
  5. 【Codeforces】Round #488 (Div. 2) 总结
  6. Roslyn 入门:使用 .NET Core 版本的 Roslyn 编译并执行跨平台的静态的源码
  7. maven搭建多模块企业级项目
  8. drill 数据库查询方式简单说明
  9. python 抓取数据,pandas进行数据分析并可视化展示
  10. FastAdmin 中使用 Oder by if 强行将某一类放到前面